Section 2 of [v2.x Oge-Example] entity Parameters
1. Location: drawing_example --> spriteparameters2. Class Name: spriteparameters
(1) Rotation genie:
Sprite. setrotation (float protation) sets the Rotation Angle
Sprite. setrotationcenter (float protationcenterx, float protationcentery) // you can specify the center of the rotation, which is centered on a certain point)
Sprite. setrotationcenterx (float protationcenterx) sets the point of the X axis rotation
Sprite. setrotationcenterx (float protationcenterx) sets the point of the X axis rotation
(2) zoom in genie:
Sprite. setscale (pscale); // you can specify a scaling factor.
Sprite. setscale (pscalex, pscaley); // set the zooming factor of X and Y
Sprite. setscalecenter (pscalecenterx, pscalecentery); // you can specify the zoom center.
Sprite. setscalecenterx (pscalecenterx); // you can specify pscalecenterx as the center scale.
Sprite. setscalecentery (pscalecentery); // set the y-axis pscalecentery point to center zoom
Sprite. setscalex (pscalex); // sets X scaling.
Sprite. setscaley (pscaley); // sets y scaling.
(3) set the width:
Sprite. setwidth (float pwidth) to set the width
(4) set the height:
Sprite. setheight (pheight); set height
(5) set transparency:
Sprite. setalpha (palpha); // sets the transparency range from 0 ~ 1
(6) invisible settings:
Sprite. setvisible (pvisible); // you can specify whether the image is visible.
(7) settings cannot be touched:
Sprite. setignoretouch (pignoretouch); // you can set whether to touch true. Do not respond to touch; false.
(8) The settings are not updated:
Sprite. setignoreupdate (pignoreupdate); // set whether to update true. Update Is Not performed. Update is performed if false.
(9) set skew:
Sprite. setskew (pskew); // sets the slope.
Sprite. setskewy (pskewx); // you can specify the y skew.
Sprite. setskewx (pskewx); // sets the X skew.
Sprite. setskew (pskewx, pskewy); // you can specify the skew of X and Y.
Sprite. setskewcenterx (pskewcenterx); // you can specify pskewcenterx as the center.
Sprite. setskewcentery (pskewcenterx); // you can specify pskewcentery as the center.
Sprite. setskewcenter (sprite. getwidth ()/2, Sprite. getheight ()/2); // set to tilt the center point
(10) set vertical flip:
Sprite. setflippedhorizontal (pflippedhorizontal); // whether to flip horizontally. True indicates flip.
(11) set horizontal flip:
Sprite. setflippedvertical (pflippedvertical); // determines whether to flip vertically. True indicates whether to flip.
Oge_example project source code
Section 2 of [v2.x Oge-Example] entity Parameters