How to deal with Retina

Previous topic - Next topic

Leginus

Now why didn't i think of that.  :noggin:
Nice one!

ampos

Even easier...

Code (glbasic) Select

If screen=480 then ratio=1   //just once at the start of the program
if screen=960 then ratio=2
if screen=1024 then ratio=2.1333

button n,x*ratio,y*ratio,witdh*ratio,height*ratio


That's how I programmed my game KRAKOUT, that support all resolutions, 320x240, 480x320, 640x480, 960x480 & 1024,768

check my web and/or my blog :D
http://diniplay.blogspot.com (devblog)
http://www.ampostata.org
http://ampostata.blogspot.com
I own PC-Win, MacBook 13", iPhone 3G/3GS/4G and iPAC-WinCE

Slydog

#32
The iPad's X-Ratio is 2.1333 (1024 / 480), but the iPad's Y-Ratio is 2.4 (768 / 320).
So, you would need two ratios, one for x, and one for y.

The iPad has a different aspect ratio so using my method allows you to customize the layout for that display.

But, ya, that should work fine, if you want the objects displayed in exact proportion and position on each device, your way would sure make things simpler!
My current project (WIP) :: TwistedMaze <<  [Updated: 2015-11-25]

Leginus

Or even easier.....

BumbleBomber 59p
BumbleBomber HD 59p
BumbleBomber for Ipad  59p
:D

Slydog

#34
Ha, took me a second to realize what 59p was (I was thinking 59 frames a second, progressive!).
That would be currency right?!  (I'm from Canada!  We use 'b' for beaver pelts!  :whistle:)

But ya, 3 separate apps, then you can control pricing and features, but for development you could use the same GLBasic project and just use the following in an 'Initializing' module (and comment / uncomment the appropriate ?DEFINE for the platform you are compiling for):
Code (glbasic) Select
?DEFINE TARGET_IPHONE
//?DEFINE TARGET_IPHONE4
//?DEFINE TARGET_IPAD

?IFDEF TARGET_IPHONE
... IPhone specific code, layout, etc
?ENDIF

?IFDEF TARGET_IPHONE4
... IPhone 4 (retina) specific code, layout, etc
?ENDIF

?IFDEF TARGET_IPAD
... IPad specific code, layout, etc
?ENDIF
My current project (WIP) :: TwistedMaze <<  [Updated: 2015-11-25]

Kitty Hello

So sorry - I really try to fix that bug quickly.

pinete

God! deal with mouse coordinates on iphone is a nightmare! Is it really as harder as it seems handle this issue in a global way? I mean, doing GLbasic the 'automatic coordinates traslation process?
There is a matter I still don't understand at all: What it is supposed to be the default Glbasic coordinates? I guess it is something to be known as it is a need in order to apply ratios to reach each screen? right?
Someone can help me a little with this issue? I'm lost since I've compiled my game in xcode and the coordinates detection is absolutely weird!
regards!

ampos

On my (horizontal) iPhone game I have this:

Code (glbasic) Select
SETACTIVEMOUSE 0
MOUSESTATE mx1,my1,b11,b21

?IFDEF IPHONE
SETACTIVEMOUSE 1
MOUSESTATE mx2,my2,b12,b22
SETACTIVEMOUSE 0
IF retina=true
my2=(my2-320)*2
mx2=mx2*2
my1=(my1-320)*2
mx1=mx1*2
ENDIF
?ENDIF


I have not tested if it is fixed in GLB 9...
check my web and/or my blog :D
http://diniplay.blogspot.com (devblog)
http://www.ampostata.org
http://ampostata.blogspot.com
I own PC-Win, MacBook 13", iPhone 3G/3GS/4G and iPAC-WinCE

Kitty Hello

I'll have to check that out. Weekend, OK?

pinete


Ampos: Thanks a lot for sharing ;) mil gracias por la info! I'll check it out and let you know..

Kitty Hello: Thanks a lot as well, I hope don't bother you but I'm pretty sure the whole GLbasic community will be very pleased if there exist an update to fix this strange x,y mouse/touch conversion as it is very uncomfortable. Thanks a lot in advance, honestly.

best,

ampos

Don't know when, but now it is fixed the iPhone 4 mouse/coordinates thing
check my web and/or my blog :D
http://diniplay.blogspot.com (devblog)
http://www.ampostata.org
http://ampostata.blogspot.com
I own PC-Win, MacBook 13", iPhone 3G/3GS/4G and iPAC-WinCE