View Single Post
Old 18th October 2002, 08:21   #3
Forum King
Naamloos's Avatar
Join Date: Mar 2001
Posts: 3,085
some more documentation :

fx_setEnabled(boolean onoff);
// turns the fx layer on or off

fx_setRect(Boolean onoff);
// if true, you handle fx_onGetPixelX() and fx_onGetPixelY()
// if false, you handle fx_onGetPixelR() and fx_onGetPixelD()

fx_setBgFx(Boolean onoff);
// if true, the layer gets its source pixels from what's underneath
// Anything in this layer itself (ie. its bitmap) won't be drawn.
// if false, the layer gets its source pixels from itself

fx_setAlphaMode(Boolean onoff);
// If true, you can handle fx_onGetPixelA() to control
// the alpha at points

fx_setGridSize(Int x, Int y);
// samples at x points on the x axis, y points on the y axis
// it interpolates between these points.
// *** NOTE: chugs if too big. Set at 10,10 for starters

fx_setWrap(Boolean onoff);
// Will wrap when getting pixels beyond extent of layer

// If you change the "fx" (rotation angle changes, etc.) you
// need to call this to redraw the layer.

fx_setClear(Boolean onoff);
fx_setSpeed(Int msperframe);
fx_setRealtime(Boolean onoff);
fx_setLocalized(Boolean onoff);
fx_setBilinear(Boolean onoff);
// haven't played with this stuff, need more info!!!!

// Callbacks
[myLayer].fx_onGetPixelX(double r, double d, double x, double y)
[myLayer].fx_onGetPixelY(double r, double d, double x, double y)
// map the x,y coming in to a different x or y.
// the range is x=-1..1 left-to-right, y=-1..1 top-to-bottom
// *** NOTE: positive Y does DOWN

[myLayer].fx_onGetPixelR(double r, double d, double x, double y)
[myLayer].fx_onGetPixelD(double r, double d, double x, double y)
// map the r,d (polar co-ordinates) coming in to a different r,d.
// the range is r=(-pi/2..3pi/2 clockwise from 9 o'clock
// *** NOTE: not your usual 0..2pi starting from 3 o'clock,
// but essentially radians (2pi of range)
// d=0..1 center-to-corner

// In the above handlers, you return the X,Y,R or D that you want
// to get the pixel from
// ie.
// horizontal mirror, fx_onGetPixelX() should return (1-x)
// rotate, fx_onGetPixelR() should return (r + angle of rotation)
// for a "lens" distortion, fx_onGetPixelD() should scale d so
// you return less than d for 0-0.707, then return d when d>0.707
// such as
// if ( d < 0.707 )
// {
// return 0.44-(0.44*cos(PI*d));
// }
// else
// {
// return d;
// }

[myLayer].fx_onGetPixelA(double r, double d, double x, double y)
// Control the alpha blending of the layer.
// return 0.0 to 1.0, full transparent to full opaque.
Naamloos is offline   Reply With Quote