Search the Community
Showing results for tags 'parent'.
Found 54 results
Hello, I have a problem with parent/child transformation. I have two meshes. I'd like to apply a rotation to one mesh, then define this mesh as parent and the other as child. But the child is also rotate. I wish to know how to rotate the parent without moving the child before assigning the parent relation. Thanks
wombat posted a topic in Phaser 2Hi, I wanted to create draggable buttons with some bitmaptext on them. I ended up with this: // the buttonvar button = this.game.add.button(x, y, "button", 0);button.input.enableDrag(false, false);// an intermediary group, just to be able to set the draggable 'button' as parentvar group = new Phaser.Group(this.game, button);// the text that i want to stick to the buttonvar text = new Phaser.BitmapText(this.game, 2, 2, "main-font", "text!!");group.add(text);Is there a more clever way to do this? For instance, the text has a 'parent' property that I can set directly, skipping the group. text.parent = button; I suppose that's from PIXI.GameObjectContainer. Presently, setting it as above works. Is there a safe way to use it, or some other way to use sprites/images/"gameobjectcontainers" as parents directly?
Hi, I am creating a character using different sprite parts and parenting it to a single sprite. //Parent spritethis.torso = group.create(0,0,actorType + '_body');this.torso.anchor.setTo(0.5, 0);//Child Sprite this.frontFoot = game.add.sprite(0,0, actorType + '_foot_front');this.frontFoot.anchor.setTo(0.5, 0);this.torso.addChild(this.frontFoot);I tried to enable the Physics body part of the parent sprite this.game.physics.enable(this.torso, Phaser.Physics.ARCADE);The result is that all child sprites have been given a body and started to drop. I just want the parent to drop itself and all child will just follow its parents. Can anyone explain further what is happening here? Any link or topics that might have discussed this?
When you link a mesh(child) to another mesh(parent) is there a way to get the child mesh's position? Because currently the position that is returned is just the initial position of the child mesh in relation to the parent mesh.