Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- player = new Player(game, 'player', 'Christian', player_number, x, y);
- player_scale = Math.min(magic.config.gameScale.x, magic.config.gameScale.y);
- player.scale.x = player_scale;
- player.scale.y = player_scale;
- player.anchor.setTo(0.5, 0.5);
- font_size = 30;
- name = game.add.text(
- 0, player.height/2, // text should go bottom of parent
- player.name,
- {/*style*/});
- name.anchor.setTo(0.5, 1);
- font_size = 50;
- number = game.add.text(
- 0, 0, // text should go to 1/4 parent (see anchor)
- player.number,
- {/*style*/});
- number.anchor.setTo(0.5, 0.25);
- player.attachments.add(name);
- player.attachments.add(number);
- game.magic.players.add(player)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement