how to make haxeflixel read data files from a spritesheet made by adobe #2375
-
i need a simple answer pls cuz im just a starter |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Hey, @wormylmao are you the same person who commented in this video? If you are, great to see you on the forums. If it's not you, please ignore my previous comment. I haven't used Adobe before but my understanding is that if you use the So something like this: // Helpers.hx
public static function loadFrames(path: String): FlxFramesCollection {
return FlxAtlasFrames.fromSparrow(
'assets/images/$path.png',
'assets/images/$path.json' // this could also be .XML file too
);
} And then you can load it into your in your sprite like this: // Player.hx
public function new(x: Float = 0, y: Float = 0) {
super(x, y);
frames = Helpers.loadFrames("characters/yeti"); NOTE: It doesn't have to be in the constructor. |
Beta Was this translation helpful? Give feedback.
Hey, @wormylmao are you the same person who commented in this video?
https://www.youtube.com/watch?v=7jUKDSL2L6E&lc=Ugw-rEIy2k5bU4S8MyB4AaABAg
If you are, great to see you on the forums. If it's not you, please ignore my previous comment.
I haven't used Adobe before but my understanding is that if you use the
fromSparrow
method in FlxAtlasFrames it should work.https://api.haxeflixel.com/flixel/graphics/frames/FlxAtlasFrames.html#fromSparrow.
So something like this: