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.

iOS and MacOS / Not loaded images over 1024 pixels

Author
Message
Sharisu
13
Years of Service
User Offline
Joined: 9th Nov 2011
Location: BY, Minsk
Posted: 9th Oct 2012 20:29 Edited at: 9th Oct 2012 20:29
I have a background size 2048x768
Load image:
     agk::LoadImage ( 1001, "data/type1.png" );
     NSLog ( @"%f", agk::GetImageWidth ( 1001 ) );
And returns:
1024.000000

Why is it, and how possible to reduce it to avoid?
Tried images 2048x2048 and 2048x1024...nothing
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 9th Oct 2012 20:39
I have discovered that iOS devices are a bit funny about oversize images.

When I tried to create an image that was a good height for the device but wider than the width set in agk::SetVirtualResolution and load it, it shrunk it so that the width fit.

This didn't happen on other platforms. And I now think I should have reported this as a bug.

What virtual resolution are you setting your app to?

Cheers,
Ancient Lady
AGK Community Tester
Sharisu
13
Years of Service
User Offline
Joined: 9th Nov 2011
Location: BY, Minsk
Posted: 9th Oct 2012 20:47 Edited at: 9th Oct 2012 20:51
For every device of their own.
I tried to set SetVirtualResolution 2048x2048 before loading resources. No result

bjadams
AGK Backer
16
Years of Service
User Offline
Joined: 29th Mar 2008
Location:
Posted: 9th Oct 2012 21:11
AGK resizes all textures bigger than 1024 on iphone and ipad.
On ipad3 the texture size limit has been increased to 2048.

All you have to do after you load your texture is to use SetSpriteSize and resize it back to the original size.
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 9th Oct 2012 21:33 Edited at: 9th Oct 2012 21:45
I didn't try resizing, I just worked around my issue.

AGK also appears to resize on Android. I tested with a double wide image and it squished it to fit.

EDIT: I just tested applying the desired size to the sprite after loading and it worked properly.

Cheers,
Ancient Lady
AGK Community Tester
bjadams
AGK Backer
16
Years of Service
User Offline
Joined: 29th Mar 2008
Location:
Posted: 9th Oct 2012 22:04
yes on smartphone all big textures are resized to 1024, so I guess this also happens on Android.

with new high res tablets I think the 1024 limit has to be reviewed.
bjadams
AGK Backer
16
Years of Service
User Offline
Joined: 29th Mar 2008
Location:
Posted: 9th Oct 2012 22:08
maybe we can post on the bug board a request for a new command.

something similar to SetResolutionMode

When this command is issued AppGameKit will not resize textures

Infact i wonder the real use of the SetResolutionMode? What is it exactly for if AppGameKit resizes down textures after I use SetResolutionMode (1) ???
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 9th Oct 2012 22:35
I've never used SetResolutionMode and on my iPod Touch (iPhone equiv) the high resolution just works when I tell it to use virtual resolution 960x640.

I suspect SetResolutionMode is only really useful when using the percentage system.

Cheers,
Ancient Lady
AGK Community Tester
bjadams
AGK Backer
16
Years of Service
User Offline
Joined: 29th Mar 2008
Location:
Posted: 10th Oct 2012 00:40
that's why with or without SetResolutionMode i see no difference, cos i never use the % system myself
xGEKKOx
AGK Master
15
Years of Service
User Offline
Joined: 7th Dec 2008
Location: Italy
Posted: 10th Oct 2012 06:02 Edited at: 10th Oct 2012 06:02
Yes this was an old bug i noticed to the team.
I don't know if they solved for the next release.
Infact i'm using to clue much 1024 backgrounds in my games to get the scrolling.

Anyway i've discovered a strange thing.
If we use the obj c coordinates, they seems to stop to 480x320.
I tried to enlarge the NIB but sometimes work and sometimes don't work.
We must investigate this thing as i didn't tried on iphone with a 1024+ screen.

Long life to Steve!
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 10th Oct 2012 17:23
bjadams, while looking at the differences in files for v1082 ios, I discovered that the UntitledViewController.m file has always (at least as far back as v1076) called agk::SetResolutionMode(1) before initializing the GL stuff.

So, that is why no one ever sees any difference when they call the funciton directly.

Cheers,
Ancient Lady
AGK Community Tester
Sharisu
13
Years of Service
User Offline
Joined: 9th Nov 2011
Location: BY, Minsk
Posted: 26th Oct 2012 15:18
So far as I understand now, it will not solve?
Gibbon28
12
Years of Service
User Offline
Joined: 22nd Oct 2012
Location: Derbyshire, UK
Posted: 27th Oct 2012 15:18
Without, hi-jacking thread, i didnt realise this issue and just have a quick question.

I was recently thinking of doing a platformer style game, if this is the case how does one do a platformer? would i have to keep all scrolling backgrounds split into 1024 images and load them as you go?

(as apposed to a large background?)

Thanks
Andy
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 27th Oct 2012 18:04
Sharisu, have you tried resizing the sprite after loading it as bjadams suggested?

Cheers,
Ancient Lady
AGK Community Tester
Sharisu
13
Years of Service
User Offline
Joined: 9th Nov 2011
Location: BY, Minsk
Posted: 28th Oct 2012 15:24
Yes, but changing the size of the sprite is not suitable. It increases, but I have it high quality images (background scrolls with deviation to the left / right). You can certainly use the two images, but this is a hack.

Login to post a reply

Server time is: 2024-11-21 13:20:52
Your offset time is: 2024-11-21 13:20:52