Prev | Current Page 999 | Next

L. McColl-Sylvester and F. Ponticelli

"Professional haXe and Neko"

flip();
mng.delay( 40 );
}
Chapter 19: Multimedia with Neko
543
batSrf.free();
mng.close();
}
}
The alternative to the transform function is the transformSurface method. This method differs only
slightly, and provides the following signature:
var bgColor : Int = 0x000000;
var angle : Float = 90.0;
var scale : Point = new Point( 0.5, 0.5 );
var flags : Int = Surface.DEFAULT;
srf.transformSurface( bgColor, angle, scale, flags );
Here, instead of drawing the resulting rotation to a Surface , it is instead returned on a new Surface
object, leaving the original Surface unchanged. The new parameter, bgColor , is the color of the new
Surface in general where the transformed Surface is not drawn. One would usually opt to use a color
that can be keyed for this parameter.
The remaining function for performing transforms is the setAlpha method. As expected, setAlpha
alters the alpha value for the entire image to between 0 and 100 percent. The result then replaces the
image in memory.
var percentage : Int = 100;
srf.


Pages:
987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011