Porting Problems (Android)

Hi everyone,

So I’ve been developing a game for a project at school, and when I went to port it, I got an error. It runs fine on the emulator, and I checked the cases of all the words and they seem to be correct. I’ll throw in some code to help explain what I’m talking about.

local bossAttackSheet =

{

    width = 399,

    height = 304,

    numFrames = 26

}

local sheet_king2 = graphics.newImageSheet(“attackKing.png”,bossAttackSheet)

So there is the code, I and attached the picture. I get a runtime error when the code reaches the newImageSheet line. It says:

Incorrect number of frames (w,h) = (399,304) with border (0) in texture (w,h) = (2599,305). Failed after frame 7 out of 26.

I also realized the the texture width and height are half of the actual image. I also get a different error on a different android device. 

Overall I am pretty confused. Any help is greatly appreciated.

I’m going to speculate here and guess it’s related to us downsizing images to 2048 on the long size on Android so that we don’t exceed the MaxTextureSize on devices that don’t report it correctly.  Maybe you could redo the sheet so that it fits in a 2048x2048 box.

Rob

It worked, you were right. Rob you’re a gem. Thank you.

I’m seeing this issue also on Mac, but not on Android:

File: main.lua

Line: 90

Incorrect number of frames (w,h) = (256,64) with border (0) in texture (w,h) = (256,64). Failed after frame 2 out of 4.

What exactly is this? Again, it works on Android.

Thx

Hi @carey.green,

The community/staff will need more information to assist you, in particular some code which shows how you’ve set up the image sheet and whatever display objects are utilizing it. Please remember to surround your code with “lua” tags for clarity:

[lua] -- code [/lua]

Thanks,

Brent

I’m going to speculate here and guess it’s related to us downsizing images to 2048 on the long size on Android so that we don’t exceed the MaxTextureSize on devices that don’t report it correctly.  Maybe you could redo the sheet so that it fits in a 2048x2048 box.

Rob

It worked, you were right. Rob you’re a gem. Thank you.

I’m seeing this issue also on Mac, but not on Android:

File: main.lua

Line: 90

Incorrect number of frames (w,h) = (256,64) with border (0) in texture (w,h) = (256,64). Failed after frame 2 out of 4.

What exactly is this? Again, it works on Android.

Thx

Hi @carey.green,

The community/staff will need more information to assist you, in particular some code which shows how you’ve set up the image sheet and whatever display objects are utilizing it. Please remember to surround your code with “lua” tags for clarity:

[lua] -- code [/lua]

Thanks,

Brent