-1

I would like to add Text or Picture to a createjs.Sprite object, to create similar sprites.

How can I achieve this? I think create a createjs.Container for each Sprite is a waste of resource.

Like the picture, how to add the numbers to the background and create the sprite?

sprite series

leetom
  • 723
  • 1
  • 6
  • 27
  • Sharing your research helps everyone. Tell us what you've tried and why it didn't meet your needs. This demonstrates that you've taken the time to try to help yourself, it saves us from reiterating obvious answers, and most of all it helps you get a more specific and relevant answer! Also see [how to ask](http://stackoverflow.com/questions/how-to-ask) – Cerbrus Feb 27 '15 at 08:21
  • @Cerbrus Actually, I have no idea how to do it. Use `createjs.Container` is not a right solution. – leetom Feb 27 '15 at 12:08

1 Answers1

0

You want to group a number of separate elements together into one object, in order to manipulate as a whole. This is exactly what Container is for.

var badge = new createjs.Container();
// add all the pieces:
badge.addChild(bubble, numLabel, stars);
// manipulate as one element:
badge.on("click", doStuff);
badge.scaleX = badge.scaleY = 1.2;
gskinner
  • 2,478
  • 11
  • 12