Open ramachandran-prazas opened 9 years ago
You can nest entities inside eachother and move the parent entity's sprite.
var myEntity = new Entity()
.add(new FillSprite(0x154d79, 100, 100)); // blue square
var myNestedEntity = new Entity()
.add(new FillSprite(0xefbf74, 40, 40)); // orange square
System.root.addChild(myEntity);
myEntity.addChild(myNestedEntity);
// move container using sine motion. the child entity automatically follows
myEntity.get(Sprite).x.behavior = new Sine(0, 200, 2);
https://github.com/markknol/flambe-guide/wiki/Flambe-core#nesting-entities
Hi,
Is there a way to move / modify all the contents of an entity instead of moving / modifying them individually.
Thanks.