Posted: 24th Aug 2011 1: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.
Posted: 24th Aug 2011 1:50
+ Code Snippet
dw# = GetDeviceWidth() / 1.0
dh# = GetDeviceHeight() / 1.0
SetDisplayAspect(dw#/dh#)



Should do the trick, in theory.
Posted: 24th Aug 2011 5:31
That works but even better this works.

+ Code Snippet
dw# = getdevicewidth()
dh# = getdeviceheight()
SetDisplayAspect(dw#/dh#)


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.
Posted: 24th Aug 2011 5:33
Isn't programming fun!!