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 / SetSpriteImage BUG

Author
Message
xGEKKOx
AGK Master
15
Years of Service
User Offline
Joined: 7th Dec 2008
Location: Italy
Posted: 28th May 2012 04:13 Edited at: 28th May 2012 04:15
When you change image of a sprite with an animation, it bug and do a bad calculation of the frames, showing the 1/3 of the image.
It also bug if you recreate the sprite.

The 1054 work but say scaling the image by 4.0
The 1075 don't say scale but is obvious it do something.

I need to use png more than 2000px, what i can do?

Returning to 1054.
This is very sad for me, very very sad.


iPhone/iPad Games/Apps : Street Karate Fighter - 90s VideoPokers Simulator - Ball VS Brick - CB RadioBox - Artic
xGEKKOx
AGK Master
15
Years of Service
User Offline
Joined: 7th Dec 2008
Location: Italy
Posted: 28th May 2012 05:29
I confirm after further investigations, that SetSpriteAnimation and SetSpriteImage don't work for a new image assigned to sprite even if the same size and same shape.

iPhone/iPad Games/Apps : Street Karate Fighter - 90s VideoPokers Simulator - Ball VS Brick - CB RadioBox - Artic
bjadams
AGK Backer
16
Years of Service
User Offline
Joined: 29th Mar 2008
Location:
Posted: 28th May 2012 09:57
I don't think AppGameKit supports sprite sizes bigger than 1024 pixels unless its run on ipad3
MarcoBruti
13
Years of Service
User Offline
Joined: 20th Nov 2011
Location: Caput Mundi
Posted: 28th May 2012 11:19
As bjadams says, It depends probably on max texture size that depends on the device graphic chipset. By a trivial seach on Internet, I found the following to find max texture size on Android devices:

This code for Android, but for sure that will be something equivalent for iOS.
Anyway a sprite of 2000px is really very large, consider that on my laptop PC (with DirectX), DarkBasicPro allowed me a max of 4096px for an image. It depends on graphics cards.
On mobile devices, I suppose that the limit is tighter...
polomint
12
Years of Service
User Offline
Joined: 3rd Apr 2012
Location: Lancashire, United Kingdom
Posted: 28th May 2012 11:21
I use 2048 x 600 pngs which work fine on AppGameKit for Windows and PB. I am using v1074, although it also worked fine for me on v1065.

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: 28th May 2012 12:14
@xGEKKOx, can you provide a simple example?

xGEKKOx
AGK Master
15
Years of Service
User Offline
Joined: 7th Dec 2008
Location: Italy
Posted: 28th May 2012 13:40 Edited at: 28th May 2012 13:48
Thx Marco, i also thought it was the max size, but on 1054 work.
This is the example.

Obvious this is called after sprite creation for refresh movements only if the Animation is different from the last.

The code is in italian, but i think is clear.
Squadra = Team
Player_controllato = player_controlled
Ombre = shadows

This night i lowered the png but it say scaled x2 now.
On 1075 don't say scaled but don't work, it can't calculate the frame counts and tell me there are 14 frames instead of 245.
On 1054 scaled x2 but work.

I also seen that the 1054 go much better, the graphic is much clear, faster and pixel perfect.
The PNG i'm using was 900x2350px and now 720x1800.

iPhone/iPad Games/Apps : Street Karate Fighter - 90s VideoPokers Simulator - Ball VS Brick - CB RadioBox - Artic
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 28th May 2012 13:54
Quote: "The code is in italian, but i think is clear."

That's OK, I speak a little portuguese, it's not so terribly different (no cultural offense intended to either language).

Without knowing the number of frames you are trying to load etc I can't debug it.

For example what is this value?
AniPlayer[Squadra[0].Player[player_controllato].current_ani].tot_frame

Any chance you could provide a working version that I can compile (Tier 1 or 2)?

bjadams
AGK Backer
16
Years of Service
User Offline
Joined: 29th Mar 2008
Location:
Posted: 28th May 2012 14:42
Gekko try to use SetSpriteSnap & see if the graphics are more pixel perfect!
xGEKKOx
AGK Master
15
Years of Service
User Offline
Joined: 7th Dec 2008
Location: Italy
Posted: 28th May 2012 20:23 Edited at: 28th May 2012 20:32
No sorry baxslash, i can't.
tot frame are the total frame for the animation function.
Lol BJ what kind of command is this, i will test it.
See you later.

Edit : I'm reading the SetSpriteSnap, seems to be not for the Image size.
Anyway is strange that the 1054 version even if scale it x2 it work well.
What do you think?

Edit 2 : Thx to TGC for adding old version in the download section!

iPhone/iPad Games/Apps : Street Karate Fighter - 90s VideoPokers Simulator - Ball VS Brick - CB RadioBox - Artic
xGEKKOx
AGK Master
15
Years of Service
User Offline
Joined: 7th Dec 2008
Location: Italy
Posted: 28th May 2012 20:55 Edited at: 28th May 2012 21:23
Now testing on the 1074....
I will update for info....

Ok i confirm the BUG is in the auto scale of the image (also in 1074 & 1075) and the image max size that is not more 1024 on iPad2 and iPhone 3gs.
On the other device i don't know.

iPhone/iPad Games/Apps : Street Karate Fighter - 90s VideoPokers Simulator - Ball VS Brick - CB RadioBox - Artic
bjadams
AGK Backer
16
Years of Service
User Offline
Joined: 29th Mar 2008
Location:
Posted: 28th May 2012 22:24
Well this is not a bug.

It's how AppGameKit works.

Anything bigger than 1024 by 1024 will be resized down to 1024 x 1024.

So just split your artwork in different files.

On iPad3 the max texture size is 2048 x 2048
xGEKKOx
AGK Master
15
Years of Service
User Offline
Joined: 7th Dec 2008
Location: Italy
Posted: 29th May 2012 00:51
Ahhh, so is normal...
Thx BJ, i will split PNG if i need in more files.
Anyway now i'm using 1074 with file split and seems to be ok.

iPhone/iPad Games/Apps : Street Karate Fighter - 90s VideoPokers Simulator - Ball VS Brick - CB RadioBox - Artic

Login to post a reply

Server time is: 2024-11-23 14:13:22
Your offset time is: 2024-11-23 14:13:22