Older Newer
Mon, 17 Nov 2008 03:51:15 . . . . adsl196-109-51-217-196.adsl196-10.iam.net.ma

Changes by last author:

= set_psetp_mode =

== Syntax ==

:void set_psetp_mode(n)

== Arguments ==


::Set n to 1, if you want to be able to set alpha to 0 with psetp. Set n to 0 to restore default behavior again.

== Return ==


== Description ==

By default, you can't set the alpha channel to zero with psetp. This is an intended behavior, that allows to use psetp function in conjuction with RGB function without messing up alpha channel ( i.e psetp(x,y,RGB(r,g,b)) ). To cancel this behavior, just do the instruction set_psetp_mode(1).

== Example ==




//------- the default color is orange, but ---

//------- you can change it with sliders -----

ctl[0]:"R value",range=(0,255),val=255

ctl[1]:"G value",range=(0,255),val=128

ctl[2]:"B value",range=(0,255),val=0

ForEveryTile: {

int color;

if ( Z<4 ) { //check if alpha channel available

Info( "This plugin needs to be applied to a layer to achieve the effect" );

return true;


//------- the important line :


for(y=y_start;y<y_end;y++) {

for(x=x_start;x<x_end;x++) {

if( ((x%100)<50) ^ ((y%100)<50) ) {//chess board pattern


} else {





}//end for x

}//end for y

return true;

}//end ForEveryTile


== Also see ==

:psetp, srcp, pgetp, RGB, RGBA

== Comments ==

:Everyone can add his comments about his experiences with this function here. Tips for using it are welcome, too.