Chapter 19: Multimedia with Neko
541
var screen : Surface = mng.getScreen();
var angle : Float = 90.0;
var scale : Point = new Point( 1, 1 );
var pivot : Point = new Point( 50, 50 );
var destination : Point = new Point( 0, 0 );
var flags : Int = Surface.DEFAULT;
var renderedArea : Rect = srf.transform( screen, angle, scale, pivot, destination,
flags );
The screen parameter is the private srf variable in the Surface class or the returned value of the
getScreen method of the Manager class. If using a Surface , you will need to prepend the transfer
using the untyped keyword, so as to please the compiler. This value is the raw C struct representing the
image in memory.
The angle parameter is a float value from 1 to 360 and represents the angle of rotation in degrees. If you
do not want to apply a rotation, you can simply pass 0. The pivot parameter is paired with this value,
and represents where on the source image the rotation should occur, as contained in a Point class
instance.
The third parameter, scale , represents the amount at which the image should be, well, scaled.
Pages:
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008