littlebuddy98 Posted February 15, 2016 Share Posted February 15, 2016 Hey guys i have been trying to draw a JSON image into my Phaser game and i was wondering if anyone knows how to do it ? Any help is much appreciated thanks Link to comment Share on other sites More sharing options...
Zeterain Posted February 15, 2016 Share Posted February 15, 2016 I'm not sure what you mean by "JSON image." If you are loading a spritesheet with JSON data, here are a few references you might find useful: Loading data: http://phaser.io/docs/2.4.4/Phaser.Loader.html#atlas http://phaser.io/docs/2.4.4/Phaser.Loader.html#atlasJSONArray http://phaser.io/docs/2.4.4/Phaser.Loader.html#atlasJSONHash Using the data: http://phaser.io/examples/v2/animation/change-frame http://phaser.io/examples/v2/animation/local-json-object Link to comment Share on other sites More sharing options...
littlebuddy98 Posted February 16, 2016 Author Share Posted February 16, 2016 Thanks for the reply but I mean a json image as in a sloped image that collides with the slope, not the square around it if you know what i mean? Link to comment Share on other sites More sharing options...
Zeterain Posted February 16, 2016 Share Posted February 16, 2016 Ah, so you just want the sprite to use a non-rectangular physics body? In that case, you can use any image you want, and adjust the physics body as needed. Here's an example of the ninja physics system showing a collision between a square and an object with a sloped body. http://phaser.io/examples/v2/ninja-physics/ninja-aabb-vs-tile Link to comment Share on other sites More sharing options...
littlebuddy98 Posted February 16, 2016 Author Share Posted February 16, 2016 OK thanks i am currently looking into that. Much thanks for being active and helpful Link to comment Share on other sites More sharing options...
Recommended Posts