MADRIX Forum • Madrix script - ALPHA constant ignored
Page 1 of 1

Madrix script - ALPHA constant ignored

Posted: Thu Jun 01, 2017 1:19 pm
by qniens
The ALPHA constant is ignored in the SetPixel draw function.

Code: Select all

@scriptname="";
@author="";
@version="";
@description="";

void InitEffect()
{

}

void RenderEffect()
{
	color red		= {255,0,0,0,0};
	SetPixel(red, 10,10);
    	
  	color opacity	= {0,0,0,0,0};  
	SetPixel(opacity,10,10,ALPHA);
	
	//expected result -> The pixel stays red
	//returned result -> The pixel becomes black
	//ALPHA constant is ignored
}

void MatrixSizeChanged()
{
	InitEffect();
}
Is there a work around for this problem?

Best regards,
Quinten

Re: Madrix script - ALPHA constant ignored

Posted: Tue Jun 06, 2017 2:39 pm
by Guertler
Hello qniens,
.
Thank you for reporting the issue. At the moment it is not possible to work with the ALPHA parameter in the "Draw" functions.
.
A work around could be to work again with the "SetPixel" function but without the "ALPHA" parameter and set everytime the desired color. Maybe you need to calculate a mix color first.
Or if you only want to dim the pixel you can work with the function "DimPixel(float value, int x, int y)".

Re: Madrix script - ALPHA constant ignored

Posted: Tue Jun 06, 2017 2:58 pm
by qniens
Hello Guertler,

Thank you for your reply.
The work around is workable.

Perhaps you should remove the paragraph about the ALPHA constant in the manual:
http://help.madrix.com/m3/html/script/i ... and_c.html

Best regards,
Quinten