Skip to content
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

generateAssetClass.js #25

Closed
chessIthaca opened this issue May 12, 2017 · 1 comment
Closed

generateAssetClass.js #25

chessIthaca opened this issue May 12, 2017 · 1 comment

Comments

@chessIthaca
Copy link

Hi,

there is a bug in line 213 of generate AssetClass:

for (var a in json['frames']) {
    frameFull = (json['frames'][a]['filename']);
     frame = frameFull.substring(0, frameFull.lastIndexOf('.'));                 
     shell.ShellString('\n        ' + toPascalCase(frame) + ' = <any>\'' + frameFull + '\',').toEnd(assetsClassFile);
}

assets in the atlas do not need to have a .png (or any extension) in the name. a simple fix is to add:

if (frame === "") {
    frame = frameFull;
 }

sample asset file:

{
    "frames": [{
            "filename": "Foo",
            "frame": { "x": 1627, "y": 1198, "w": 32, "h": 34 }
    }]
}
@rroylance
Copy link
Owner

rroylance commented May 12, 2017

Thanks! I forgot about that. I'll get that fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants