Jump to content

how to write on the sprite


stone
 Share

Recommended Posts

Ok the best way to do this will be to add the text as a child of your sprite. Something like this: 

sprite = game.add.sprite(10, 10, 'mySprite');text = game.add.text(0,0, 'This is some text');sprite.addChild(text);

By doing that the text will automatically move with the sprite, and is positioned relative to the sprites anchor too. Hope that helps :) 

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...