Advertisement
Guest User

Untitled

a guest
Jul 24th, 2014
208
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. player = new Player(game, 'player', 'Christian', player_number, x, y);
  2. player_scale = Math.min(magic.config.gameScale.x, magic.config.gameScale.y);
  3. player.scale.x = player_scale;
  4. player.scale.y = player_scale;
  5. player.anchor.setTo(0.5, 0.5);
  6.  
  7. font_size = 30;
  8. name = game.add.text(
  9.     0, player.height/2, // text should go bottom of parent
  10.     player.name,
  11.     {/*style*/});
  12. name.anchor.setTo(0.5, 1);              
  13.  
  14. font_size = 50;
  15. number = game.add.text(
  16.     0, 0,           // text should go to 1/4 parent (see anchor)
  17.     player.number,
  18.     {/*style*/});
  19. number.anchor.setTo(0.5, 0.25);
  20.  
  21. player.attachments.add(name);  
  22. player.attachments.add(number);
  23. game.magic.players.add(player)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement