Jump to content

can i use a atlas for the whole game?


nak3ddogs
 Share

Recommended Posts

hi! i would minimalize my game. 
the atlas and tinypng look like the best solution for it. 
can i use 1 atlas for all sprite?
and how can i use it?

 function preload() {          game.load.atlas('sprites', 'assets/sprites.png', 'assets/sprites.js');} function create() {         game.bg = this.game.add.tileSprite(0,0, 800 ,480, 'sprites', 'container.png');          game.bg.autoScroll(-20,0);          game.bg.fixedToCamera = true;          player = game.add.sprite( 48,  game.world.height, 'sprites.png');}

it wont work for me

 

pls help

Link to comment
Share on other sites

short answer:  YES

 

you can use one big atlas for all your sprites, tilesprites, images, buttons, animations ...

player = this.game.add.sprite(100,100,, 'sprites', 'player.png');
 button=game.add.button(x, y, 'sprites', function(){ }, this, 'button-inactive.png', 'button-active.png', 'button-active.png.png');
Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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