M
MexicanBurrito
Guest
Hello everyone!
Yesterday I created a system to change the aspect ratio of my game when I click either 1,2,3, or 4 and it worked! It resized views acordingly and the application surface aswell. Today I wanted the game to do it automatically. I tried to get my boyfriend to help me but he was a clueless as I
Its just to cover the normal aspect ratios and 21 / 9 just for fun then it stores the result in these global variables.
Then it checks the global variables and resizes the game accordingly.
This all worked out fine when the first code part was inputed physically and now it doesn't. Maybe there is something wrong with the code
any help would be appreiceated.
Yesterday I created a system to change the aspect ratio of my game when I click either 1,2,3, or 4 and it worked! It resized views acordingly and the application surface aswell. Today I wanted the game to do it automatically. I tried to get my boyfriend to help me but he was a clueless as I
Code:
if (display_get_height() / display_get_width() == 1.777777777777778)
{
global.threebyfour = 0
global.sixteenbynine = 1
global.sixteenbyten = 0
global.twentyonebynine = 0
}
else if (display_get_height() / display_get_width() == 1.6)
{
global.threebyfour = 0
global.sixteenbynine = 0
global.sixteenbyten = 1
global.twentyonebynine = 0
}
else if (display_get_height() / display_get_width() == 2.333333333333333)
{
global.threebyfour = 0
global.sixteenbynine = 0
global.sixteenbyten = 0
global.twentyonebynine = 1
}
else if (display_get_height() / display_get_width() == 1.333333333333333)
{
global.threebyfour = 1
global.sixteenbynine = 0
global.sixteenbyten = 0
global.twentyonebynine = 0
}
Code:
if (global.threebyfour = 1)
{
view_hview[0] = 270;
view_wview[0] = 360;
view_hport[0] = 270;
view_wport[0] = 360;
surface_resize(application_surface, 360, 270);
}
else if (global.sixteenbynine = 1)
{
view_hview[0] = 270;
view_wview[0] = 480;
view_hport[0] = 270;
view_wport[0] = 480;
surface_resize(application_surface, 480, 270);
}
else if (global.sixteenbyten = 1)
{
view_hview[0] = 300;
view_wview[0] = 480;
view_hport[0] = 300;
view_wport[0] = 480;
surface_resize(application_surface, 480, 300);
}
else if (global.twentyonebynine = 1)
{
view_hview[0] = 270;
view_wview[0] = 630;
view_hport[0] = 270;
view_wport[0] = 630;
surface_resize(application_surface, 630, 270);
}
This all worked out fine when the first code part was inputed physically and now it doesn't. Maybe there is something wrong with the code
any help would be appreiceated.