-
Notifications
You must be signed in to change notification settings - Fork 435
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
Issues with FlxFrame.checkValidName
#3091
Comments
can you share the code used to load the xml? |
while trying to create a simplified repro, i've realized it might be an issue with the project i'm working with, i can't reproduce it in a new flixel template using the previously mentioned xml this is the original class i was working with, however it does have a lot of seemingly (?) unrelated functionality, which is why i wanted to cut it down for clarity, i haven't been able to deduce why this code fails, and my smaller repro doesn't |
I don't need a simplified repro, though thanks for trying, I just need a snippet from the project showing how you are parsing the txt and creating the animations |
👍 |
im pretty sure the issue here is because when you generate a spritesheet in flash/adobe animate from the stage instead of the library, it adds "instance" followed by a number, which i think is the amount of versions of one symbol that you are exporting (like different scales maybe?) but i havent really tested this. |
Any updates on my previous request @DetectiveBaldi ? |
I linked the class with the XML error in my last comment, from what I can gather the animations are added here The associated XML can also be found here
This seems to be the case, removing the number seems to fix the issue in most cases, however in certain cases, the error still seems to occur? The error also seems to happen if the XML name has an exclamation point in it |
looking into this, again. is the issue that |
Yes, that seems to be the issue, I can now reliably reproduce the error. var sprite:FlxSprite = new FlxSprite();
sprite.frames = FlxAtlasFrames.fromSparrow("assets/images/alphabet.png", "assets/images/alphabet.xml");
// sprite.animation.addByPrefix("#", "# bold", 24, true); // Causes error
sprite.animation.addByPrefix("#", "# bold instance", 24, true); // Runs successfully
add(sprite); The animation on the XML being: |
I think in this case it should try and parse the numbers in "instance 00001" and warn you that you should either generate better frame names, or include "instance " in your prefix |
in flixel 5.6.1 (?), a new function was added to
FlxFrame
, that beingcheckValidName
. the function warns for invalid (?) frame names i presumethis function seems to cause more issues then it solves however, when compiling one of my projects in debug, i get bombarded with errors from this line. the game still functions the same, the only issue is i have a ton of errors flooding my log
the errors being:
for reference, here is the xml i am referencing (converted to txt due to isses with github)
alphabet.txt
i have to ask, is this
FlxFrame
function required? in it's current state the only mention of it i've seen is it causing issues with pre-existing projectsif this function must be kept, i would like to atleast know how to fix these errors
The text was updated successfully, but these errors were encountered: