fengFanYong Posted February 2, 2018 Share Posted February 2, 2018 Can I use an sprite as a container? for example: var sprite = new PIXI.Sprite; var graphics = new PIXI.Graphics(); sprite.addChild(graphics); The position of the graphics relative to the local coordinates of the sprite. Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted February 2, 2018 Share Posted February 2, 2018 Yes. Quote Link to comment Share on other sites More sharing options...
fengFanYong Posted February 3, 2018 Author Share Posted February 3, 2018 @ivan.popelyshev How to set up transform of graphics? I want The size of the graphics Independent to the local coordinates of the sprite,for example: var sprite = new PIXI.Sprite(); sprite.width = 10; sprite.height = 20; var grphics = new PIXI.Grphics(); grphics.width = 10; grphics.height = 10; I want get the size of grphics is 10*10. Thank! Quote Link to comment Share on other sites More sharing options...
Gerente Posted February 3, 2018 Share Posted February 3, 2018 If you use a sprite as container it will SCALE every child on it when you resize it from the original resource size. Quote Link to comment Share on other sites More sharing options...
botmaster Posted February 7, 2018 Share Posted February 7, 2018 That's an illogical approach, if you can trasnform the container but don't want to transform the children then those children shouldn't be in that container to start with or that container shouldn't be able to transform, one or the other. You need to rethink your approach or probably explain what you are trying to achieve so we can tell you how to do it. 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.