Jump to content

v3 - Sprite position relative to container?


Oyed
 Share

Recommended Posts

I'm working with multi-leveled containers and I'd like to know if the position of the sprite(s) inside a container is relative to the containers position? For example;

var container1 = new PIXI.ParticleContainer(),    container2 = new PIXI.ParticleContainer(),    mySprite = new PIXI.Sprite(someTexture);mySprite.x = 10;mySprite.y = 15;container1.addChild(mySprite);container1.x = 50;container1.y = 100;container2.addChild(container1);

Would "mySprite"s X and Y be rendered as 60,115 - or are the co-ordinates not relative to the container and will be rendered at 10,15?

 

Thanks!

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