Legomite Posted August 24, 2015 Share Posted August 24, 2015 I'm trying to anchor a sprite to the top right, I want to do something likesprite.anchor.set(-1 - sprite.width, 0)How do I get the width of a sprite? Quote Link to comment Share on other sites More sharing options...
LinkTree Posted August 24, 2015 Share Posted August 24, 2015 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.3http://www.pandajs.net/docs/v2(in development)http://ekelokorpi.github.io/panda.js-site/engine/docs/pixi.jshttp://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# Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.