Sign in to follow this  
RookieDev

Can i get some help with this code?

Recommended Posts

Im new here so im guessing this is the right spot for this question.

 

Im using Game Maker Studio and im making an android game i have a code that is a universal script but im not sure how to place it into my game.

I was wondering if i could get some help with it

 

{
// Set the size of the display
globalvar DISPLAY_WIDTH, DISPLAY_HEIGHT;
if (YoYo_GetPlatform() == os_ios && YoYo_GetDevice() == 2)
{ DISPLAY_WIDTH = 1024; DISPLAY_HEIGHT = 768; }
else
{ DISPLAY_WIDTH = 960; DISPLAY_HEIGHT = 640; } 
// Set the views in the rooms
room_set_view_enabled(room_title,true);
room_set_view(room_title,0,true,(1024 - DISPLAY_WIDTH) div 2,
(768 - DISPLAY_HEIGHT) div 2,DISPLAY_WIDTH,DISPLAY_HEIGHT,
0,0,DISPLAY_WIDTH,DISPLAY_HEIGHT,0,0,-1,-1,-1);
// Add views for the other rooms here 
// Now go to the title menu room
room_goto(room_title);
}

 

Im trying to figure out where i should put my room names for the size adjustment to take place,I have been messing around with this for awhile and i havnt been able to come up with anything.Can someone help me out?

Share this post


Link to post
Share on other sites

Looks like a function body without header, what language is that ?

 

As to your question it looks like you must duplicate these two lines and replace room_title with your room names like so


room_set_view_enabled("room1",true);
room_set_view("room1",0,true,(1024 - DISPLAY_WIDTH) div 2,
(768 - DISPLAY_HEIGHT) div 2,DISPLAY_WIDTH,DISPLAY_HEIGHT,
0,0,DISPLAY_WIDTH,DISPLAY_HEIGHT,0,0,-1,-1,-1);

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this