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 work agk::GetDeviceWidth and agk::GetDeviceHeight() on iPhone

Author
Message
Commandor
13
Years of Service
User Offline
Joined: 25th Jan 2011
Location: Kiev, Ukraine
Posted: 7th Oct 2012 19:47 Edited at: 7th Oct 2012 20:04
Hi all!

Not work agk::GetDeviceWidth() and agk::GetDeviceHeight() for iPhone. For iPad and Windows - work.


What if many sprites are tied to the size of the device screen?

Life is our game, playing we live!
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 7th Oct 2012 20:24
I'll test those commands as well as the ones in your other post.

Cheers,
Ancient Lady
AGK Community Tester
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 8th Oct 2012 21:05
I ran this on my iPod Touch (iPhone w/out the phone) and it reported the values correctly:


In theory, there is something different on an iPhone than iPod Touch that might be causing your issue.

What iOS version do you have on your devices? And what do you have for your Deployment Target in your project?

Cheers,
Ancient Lady
AGK Community Tester
Commandor
13
Years of Service
User Offline
Joined: 25th Jan 2011
Location: Kiev, Ukraine
Posted: 8th Oct 2012 22:45
I'll try your code

Life is our game, playing we live!
Commandor
13
Years of Service
User Offline
Joined: 25th Jan 2011
Location: Kiev, Ukraine
Posted: 9th Oct 2012 09:45
Your code is not working for me.

1) iOS 4.3, Target 4.3
2) iOS 5.1, Target 5.1

I am testing on simulator, because I do not have iPhone. Maybe I'm not doing right and wrong sprites placed on iPhones?



Please, help me...

Life is our game, playing we live!
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 9th Oct 2012 17:03
Did you run a project with only the code I posted (without doing anything else or including anything else)?

What does your setup look like? Are you calling the SetVirtualResolution command? If so, what values are you passing?

Cheers,
Ancient Lady
AGK Community Tester
Commandor
13
Years of Service
User Offline
Joined: 25th Jan 2011
Location: Kiev, Ukraine
Posted: 10th Oct 2012 11:48
I solved this problem: all write the exact size of the screen.

Life is our game, playing we live!

Login to post a reply

Server time is: 2024-04-20 14:16:29
Your offset time is: 2024-04-20 14:16:29