Section 2 of [v2.x Oge-Example] entity Parameters

Source: Internet
Author: User
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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.