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 / Tier 1 - Data Type Conversions

Author
Message
XanthorXIII
AGK Gold Backer
12
Years of Service
User Offline
Joined: 13th May 2011
Location:
Posted: 24th Aug 2011 01:45
For Aspect Display I'm playing around with the values. While using SetDisplayAspect(320.0/480.0) works fine there are other times that I would like to get the Display Ratio correct on other devices such as Android etc.. that have different values.

I've noticed that the GetDeviceWidth and GetDeviceHeight return Int values. As I have found out today,you have to be more precise with the values. Instead of the standard .66 that is put in, for a 320x480 resolution it needs to be 0.66666666 or 0.66666667.

Would it be possible to change the return values of those two functions to be floats or could we get some functions that will convert data types to the appropriate values?

Thanks.
KISTech
16
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 24th Aug 2011 01:50


Should do the trick, in theory.

XanthorXIII
AGK Gold Backer
12
Years of Service
User Offline
Joined: 13th May 2011
Location:
Posted: 24th Aug 2011 05:31 Edited at: 24th Aug 2011 05:33
That works but even better this works.



It finally dawned on me that in SetDisplayAspect(dw#/dh#) I need to specify the data type at the end with the #. Passing the two values, SetDisplayAspect(dw/dh) gives me the incorrect results.
The DW and DH get converted to 0 when trying to specify them as what would be an Integer and when the divide operation occurs, I get a result of 0.

Don't take my code example as being better but really just confirming my thoughts.

Just need to remember my data types when I'm using them.
KISTech
16
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 24th Aug 2011 05:33
Isn't programming fun!!

Login to post a reply

Server time is: 2024-04-23 18:23:37
Your offset time is: 2024-04-23 18:23:37