Jump to content
Sign in to follow this  
Gadwin

How can I rotate a bitmap?

Recommended Posts

I want to try to rotate the bitmap that i have created using the rotate command but it seems it nothing is happening.

is there any wrong with my setup?

 

 

this.background = new Sprite();
this.background.bitmap = ImageManager.loadSystem($.Param.background);
this.background.x = 50;
this.background.y = 400;
this.background.bitmap.rotate = 26;

Share this post


Link to post
Share on other sites

The Bitmap object doesn't have a rotate variable. Your code creates one and it isn't used anywhere.

 

The help file says that the Sprite object has a 'rotation' variable that is in radians. Try instead using:

this.background.rotation = 26;

Share this post


Link to post
Share on other sites

Also, in addition to Galv's comment, if you're working with circular objects and you want to get the proper centered rotation, you need to change the anchor.

  • Like 1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
Top ArrowTop Arrow Highlighted