Jump to content

how to write on the sprite


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


  • Recently Browsing   0 members

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