Hi,
I am currently working on a school game development project in which I am to design and produce a game suitable for play on an iPad. After recently completing the project, it occurred to me that it would be awesome to actually have the game played inside a virtual iPad, which I could achieve by adjusting the resolution of the room to fit an 'iPad' object with an iPad sprite in.
The problem is, with my resolution now adjusted, all the coordinates at which objects are created, text is drawn, etc are now incorrect. Essentially, my room used to be 1024x768, but with the iPad object now in it, I have had to re size it to 1287 x 919 in order to accommodate the iPad.
So my question is, is there anyway to adjust the origin of the room, similar to how you would adjust the origin of a sprite, so my draw and object create coordinates are correctly positioned in the room, accounting for the iPad 'border' around it?
Thanks.
Adjust Origin Point of A Room?
Started by davidc95, May 13 2012 01:50 AM
3 replies to this topic
#1
Posted 13 May 2012 - 01:50 AM
#2
Posted 13 May 2012 - 02:47 AM
1) Modify all x values by 1287-1024 and all y-values by 919-768.
2) Set one view to have the iPad picture and another view to have the actual game and draw everything according to view_xview and view_yview if they're in the game view (you'll want GM8.1 or plan to do a lot of scripting with the Pro version of GM8).
2) Set one view to have the iPad picture and another view to have the actual game and draw everything according to view_xview and view_yview if they're in the game view (you'll want GM8.1 or plan to do a lot of scripting with the Pro version of GM8).
#3
Posted 13 May 2012 - 03:10 AM
1) Modify all x values by 1287-1024 and all y-values by 919-768.
2) Set one view to have the iPad picture and another view to have the actual game and draw everything according to view_xview and view_yview if they're in the game view (you'll want GM8.1 or plan to do a lot of scripting with the Pro version of GM8).
Ah, thanks for the help, but I was hoping I wouldn't have to modify all the x and y coordinates of the millions of objects in my game to account for the new screen res. I tried doing it yesterday, but it was so time consuming.
But I guess if there is no easier work around, I will have to employ your tactic .
#4
Posted 13 May 2012 - 03:20 AM
I don't know if this will work -- I doubt it will -- but try putting in a controller object's End Step event
if view_current==0
with all visible=1
else with all visible=0
And use the two-views method I described. If it works, you won't need to change the draw events for all the objects. If it doesn't work, ignore it. And also this way it's just one little object, so if it doesn't work you don't need to worry about totally mucking up your game, just delete the object and you're back to square one. Clean and simple.
if view_current==0
with all visible=1
else with all visible=0
And use the two-views method I described. If it works, you won't need to change the draw events for all the objects. If it doesn't work, ignore it. And also this way it's just one little object, so if it doesn't work you don't need to worry about totally mucking up your game, just delete the object and you're back to square one. Clean and simple.
Edited by TheouAegis, 13 May 2012 - 03:20 AM.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users











