Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Sprite size limitation?

Author
Message
polomint
12
Years of Service
User Offline
Joined: 3rd Apr 2012
Location: Lancashire, United Kingdom
Posted: 1st May 2012 14:13
I seem to be having problems displaying a large sprite.
The size is 256x2085. I am then scaling 2*Width before displaying but all I seem to get is a white sprite. Any ideas?



The sprite png is definitely in the asset folder and named correctly, I tested it with a smaller 128*128 pixel sprite and it works correctly then..

Blackberry App Development & ZX Spectrum Game Development.
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 1st May 2012 14:28
Sprites can be just about any size I think but your images should be no larger than 2048 for some platforms and 1024 for others, otherwise you get this problem.

Hodgey
14
Years of Service
User Offline
Joined: 10th Oct 2009
Location: Australia
Posted: 1st May 2012 14:30 Edited at: 1st May 2012 14:31
Due to the limits of mobile devices (and depending on the graphics chip) any image with either dimension greater than 1024 has a chance of becoming a 'white' sprite (it might display correctly on some devices). So, to be on the safe side, keep your images below or equal to 1024x1024.

Edit- Ninja'd, once again, by baxslash.

polomint
12
Years of Service
User Offline
Joined: 3rd Apr 2012
Location: Lancashire, United Kingdom
Posted: 1st May 2012 14:40 Edited at: 1st May 2012 14:49
Thanks baxslash and Hodgey,

Looks like I'll have to think again about my map layout for this PB game, grrr,

Aha, what would be handy is a command to link sprites, so that wherever the first sprite is moved to then the second would be moved next to it (offset). I'm sure I can knock up a quick little routine to mimic it,

EDIT: Just tested and 2048px in height seems to be ok, so I'll just stitch three sprites together to get a nice and high 512*6144 level,

Blackberry App Development & ZX Spectrum Game Development.
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 1st May 2012 14:49
Quote: "Edit- Ninja'd, once again, by baxslash."

Fist pump

Quote: "Aha, what would be handy is a command to link sprites, so that wherever the first sprite is moved to then the second would be moved next to it (offset). I'm sure I can knock up a quick little routine to mimic it"

You could link sprites easily using an array:


polomint
12
Years of Service
User Offline
Joined: 3rd Apr 2012
Location: Lancashire, United Kingdom
Posted: 1st May 2012 14:51
Ahh, nice baxslash, saves me writing it, it's easy enough to convert to c++,

Blackberry App Development & ZX Spectrum Game Development.
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 1st May 2012 15:20
No problem. Might need some adjustment to suit your needs

polomint
12
Years of Service
User Offline
Joined: 3rd Apr 2012
Location: Lancashire, United Kingdom
Posted: 1st May 2012 15:52
Oooo, just noticed agk::SetViewOffset(),

I have a nice 512*6144 scrolling background, now for a hero, and some bullets!!

Blackberry App Development & ZX Spectrum Game Development.

Login to post a reply

Server time is: 2024-05-05 00:15:25
Your offset time is: 2024-05-05 00:15:25