doyouknowyou Posted November 16, 2014 Share Posted November 16, 2014 I've just tried exchanging my spritesheet for an atlas, but have found that after using an atlas the sprites load properly, but none of my functions seem to be defined? Spritesheet: game.load.spritesheet('rabbit', 'assets/rabbit_jump.png', 87, 144);Atlas: game.load.atlasXML('rabbit', 'assets/rabbit_atlas.png', 'assets/rabbit_atlas.xml');There are no errors showing whatsoever, but when I try to execute any function from the console it's always getting undefined. Here's my XML: <TextureAtlas imagePath="sprites"> <SubTexture name="EyesClosed" x="87" y="0" width="85" height="129"/> <SubTexture name="fall" x="174" y="0" width="79" height="132"/> <SubTexture name="jump" x="255" y="0" width="78" height="143"/> <SubTexture name="stand" x="0" y="0" width="85" height="129"/></TextureAtlas>And here's my rabbit sprite: player = game.add.sprite(worldX, game.world.height - 340, 'rabbit'); game.physics.arcade.enable(player); player.body.gravity.y = 1150; player.anchor.setTo(0.5,0); player.animations.add('stand', [0]); Anyone had this happen to them before? I'm kind of baffled as to why this would be happening... ******UPDATE****** Ok looks like I was being stupid, functions are working but it seems like this is causing the problem: clickLayer = game.add.sprite(worldX, worldY, 'click'); clickLayer.anchor.setTo(0.5); clickLayer.scale.setTo(4,4); clickLayer.alpha = 0; clickLayer.fixedToCamera = true; clickLayer.inputEnabled = true; clickLayer.events.onInputDown.add(jump);It doesn't look like anything is receiving input with 'events.onInputDown.add()'. Weird that this is only happening with an atlas.... Link to comment Share on other sites More sharing options...
spencerTL Posted November 16, 2014 Share Posted November 16, 2014 Could you try using JSON instead of xml? the examples use JSON so there is more stuff to help: http://examples.phaser.io/_site/view_full.html?d=animation&f=local+json+object.js&t=local%20json%20object Just an idea to quickly move on but not a great answer I know! Link to comment Share on other sites More sharing options...
doyouknowyou Posted November 16, 2014 Author Share Posted November 16, 2014 Thanks for the reply, jsut tried with json but still same problem Link to comment Share on other sites More sharing options...
Recommended Posts