-
Notifications
You must be signed in to change notification settings - Fork 289
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FlxAsepriteUtils demo #326
FlxAsepriteUtils demo #326
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Flash is lame, gotta work around these "Cannot skip non-nullable argument X" errors in all official Flixel code
Been on vacation the last week. Just getting back to cleaning this up more. I've fixed the flash target errors. I also expanded it to swap between loading tags by index and loading tags by prefix. I'm trying to think of a way to show of the difference between these. At the moment, they result in the same exact sprite and animations. Thoughts on a good way to demonstrate that? |
it might not be necessary to "show" this in the demo, maybe just choose one and write a comment above/below it FlxAsepriteUtil.loadAseAtlasAndTagsByIndex(player, "assets/player.png", "assets/player.json");
// can also use FlxAsepriteUtil.loadAseAtlasAndTagsByPrefix(player, "assets/player.png", "assets/player.json"); |
I was hoping to capture a basic use case for each method to give folks a possible reason to go one way or the other. I think I'm also trying to figure out why I personally would use the prefix. I know we chatted about this kind of stuff when we were tinkering with all of this the first time around. Exporting the sprite sheet as hash vs array is the only thing I can think of right now (as "by index" doesn't participate well with hash export). So the trade-off (and main difference, at least that I can come up with at the moment) is that loading by index doesn't work with hash export from aseprite, and loading by prefix doesn't work unless you provide a proper export 'item filename' (which imo is terrible name for what to call each frame). |
^ Adding on to previous comment, I just installed Aseprite on a fresh laptop that's never had it installed and the default |
flash errors fixed, but I still haven't tested any of this yet
I think the best option is to make a flixel plugin for Aseprite that simplifies the export process. I'm not sure how it would do that or how to make this plugin, so for now we have verbose comments on these util functions and, hopefully, a demo with an included .aseprite file with the export options saved |
If we go the route of having a flixel plugin (which I'm assuming a script is what you had in mind), where would we publish that / direct users to it? I'm going to, as part of this PR, see if I can make a preliminary script that acts as a Flixel Atlas Export tool that uses some nice default settings for exporting a spritesheet/atlas. I'll probably reach out on the discord if/when I come up with something that seems usable as it certainly won't be part of this PR. For the sake of this PR at the moment you mentioned "export options saved." It does appear that the export options are saved within the .ase file based on some preliminary testing. That should mean that the player.ase file included in this PR does have reasonable settings for the export already. |
@Geokureli -- So I took the liberty of playing around with Aseprite plugins/scripting. Came up with this: Aseprite_t5QVfCN2a3.mp4Summary of what's happening in the video:
Doing a regular "Export Sprite Sheet" will just use whatever settings you last used. It defaults to Code is here: I can also make the export happen automatically without showing the second dialog, but left it in for now to show what is happening. Not sure how we'd distribute something like this, but this seems like the start of something that aligns with what you were talking about. Let me know your thoughts! |
This is amazing, I can't believe you did this so fast! for distribution, I noticed that Aseprite isn't even on this list yet, so I can add it there and host a download link, what kind of file is the plugin? |
I was away from all technology for a week straight, so I'm quite refreshed and eager to be productive 😄 The plugins are just scripts with some extra data on them. The file itself is just a zip, but with a I've put together a little more on the repo, so the first draft of download/instructions is here. I've also expanded the dialog a bit to hopefully make it more friendly/usable. Happy to keep expanding/tweaking this if you have requests/concerns/whatever. First time digging into all this Aseprite Scripting/Plugins/Lua stuff, so I'm quite green on all of this myself. |
Created a separate issue for the plugin |
Thoughts on folders this should be in besides "Other"? I realize this folder contains FlxAtlas and FrameCollection; perhaps we should make a new folder called "Animation", "Atlases" or "Graphics". Alternatively this can go in the "Editors" folder |
I like 'graphics' as that more closely follows the flixel code structure. Maybe that makes it more intuitive to navigate the demos? |
Oops, I had pull the latest from flixel-demos, but forgot to set my haxelib to use flixel dev branch. I'll update and do a round of testing with that. I'm also noticing UI behavior that I didn't notice before (more Aseprite odd choices). In the tag properties dialog, if the |
I bring this up here: aseprite/aseprite#1989 (comment) i find it very unintuitive
To me this just adds more unintuitive steps and friction to an already unintuitive system, im wondering if the plugin can solve this |
I agree that the naming is a bit weird, specifically that the unchecked "Repeat" checkbox means it repeats literally as much as possible (forever) 😄
Can you elaborate on what you mean by "more unintuitive steps"? But the more I think on this, the more I think that using |
I keep forgetting that "Repeat: 1" means "Never Repeat" and 2 means "Repeat Once" this field is just so stupid, I see where you get > 1, now
let's have the demo use repeat:2 and start an issue in flixel about |
I have created an issue and corresponding PR (linked in issue): HaxeFlixel/flixel#2947 |
all good, waiting on CI |
No description provided.