Jump to content

Get width of sprite?


Legomite
 Share

Recommended Posts

To anchor a sprite to the top right you set the anchor to (1,0). anchor receives values between 0-1 so the center would be 0.5.

To get the width of a sprite you use sprite.width but you can't use it to set anchor since as I explained above anchors are set with 0-1.

 

Here you can find all the documentation of panda.js:

v1.3

http://www.pandajs.net/docs/

v2(in development)

http://ekelokorpi.github.io/panda.js-site/engine/docs/

pixi.js

http://www.goodboydigital.com/pixijs/docs/

 

also this site has a lot of basic examples and is very useful for learning the basics of panda.js:

http://vermeire.home.xs4all.nl/panda/index.html#

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...