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

Error #3681: Texture size is zero - on asset manager #580

Closed
matej-snivam opened this issue Jul 14, 2014 · 9 comments
Closed

Error #3681: Texture size is zero - on asset manager #580

matej-snivam opened this issue Jul 14, 2014 · 9 comments

Comments

@matej-snivam
Copy link

I get this error when loading spriteSheet.

It seems like scale turns out to be NaN so error happens. I solved it by making this modification in Texture.as on line 250

                                          scale:Number=1, format:String="bgra",
                                          repeat:Boolean=false):Texture
    {
        if (isNaN(scale)) {
            scale = 1;
        }
        var texture:Texture = Texture.empty(data.width / scale, data.height / scale, true, 
                                            generateMipMaps, optimizeForRenderToTexture, scale,
                                            format, repeat);

screen shot 2014-07-14 at 1 33 21 pm
screen shot 2014-07-14 at 1 33 29 pm

@matej-snivam
Copy link
Author

Using air for desktop

@PrimaryFeather
Copy link
Contributor

Question is, how does that NaN end up being passed to the method! Is there an error in your sprite sheet?

@matej-snivam
Copy link
Author

It goes into process raw asset, and there in texture options it is NaN.
if you want, I can send the project to you to do a quick compile to see

Matej Šimunić

On 14 July 2014 13:48, Daniel Sperl [email protected] wrote:

Question is, how does that NaN end up being passed to the method! Is there
an error in your sprite sheet?


Reply to this email directly or view it on GitHub
#580 (comment)
.

@PrimaryFeather
Copy link
Contributor

Oh yes, that would be great! Thanks in advance!

@matej-snivam
Copy link
Author

i will just zip it :) and send it in a message

@PrimaryFeather
Copy link
Contributor

My Bitbucket account is PrimaryFeather, if you prefer that. =)

@matej-snivam
Copy link
Author

I added you to skype, for easier communication. primary feather

@PrimaryFeather
Copy link
Contributor

The result of the Skype call: the AssetManager had been initialized with a scale factor of "NaN". The fix is to initialize the asset manager with a valid scale factor value.

@matej-snivam
Copy link
Author

if anyone runs into this, robotlegs injector SwiftSuspenders instantiates optional number parametar as NaN

robotlegs/swiftsuspenders#9

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