Jump to content

How to set anchor for a TilingSprite


alexzchen
 Share

Recommended Posts

I set a anchor for a TilingSprite with this code:  mySprite.tileTransform.anchor.set(0.5,0.5); but it doesn't work, when I rotate(or scale) it, it's still base on the left top.

If I want rotate or scale a TilingSprite base on the center, how shoud I do?

Link to comment
Share on other sites

try with pivot like this : 
sprite.pivot.x = sprite.width / 2;
sprite.pivot.y = sprite.height /2;

or with anchor directly using : 

mySprite.anchor... and not mySprite.tileTransform.anchor (don't know what is tileTransform)

Edited by Velith
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...