//-------------------------------- GAME SCALING ----------------------------
show_debug_overlay(0); // shows some debug info on screen like memory use, texture swaps, etc REMOVE FOR RELEASE!!
texture_set_interpolation(false); // prevent any interpolation on images
global.Interpolation=false; // to track its on or off
display_reset(0,true); // sets the anti-aliasing off (0) and vsync on (true)
global.Vsync=true; // to track when the v-sync is on/off
global.Frameskip=true; // game starts with frameskip debug code off
global.AppSurf=true; // to track if the application surface is in use or not
application_surface_draw_enable(0); // so I can control the resize and drawing of the application surface
draw_enable_alphablend(false); // disable the alpha blending of the application surface
global.GameScale=1.0; // default (no scaling)
global.Scaling="Off"; // to know if there's scaling going on or not
global.BlockWindow=false; // to block the game in windowed mode
global.BlockScaling=false; // to block the scaling option
global.MonitorW=display_get_width(); // catching the size of the display
global.MonitorH=display_get_height();
window_set_fullscreen(1); //play the game fullscreen
surface_resize(application_surface,800,450) // size of the application surface for no scaling
global.Dis_Xoffset=(global.MonitorW-800)/2; // set the position of the application surface
global.Dis_Yoffset=(global.MonitorH-450)/2;
//---------- Scale x 1.5 -------------------
if(global.MonitorW>=1200 && global.MonitorH>=675) // if the monitor's resolution is at least 1200x675...
then
{
global.Scaling="On";
global.GameScale=1.5; // to track the scale generally speaking
global.BlockScaling=false;
surface_resize(application_surface,1200,675) // set the right application surface size
global.Dis_Xoffset=(global.MonitorW-1200)/2;
global.Dis_Yoffset=(global.MonitorH-676)/2;
}
//---------- Scale x 2 -------------------
if(global.MonitorW>=1600 && global.MonitorH>=900) // full HD!
then
{
global.GameScale=2.0;
global.Scaling="On";
global.BlockScaling=false;
surface_resize(application_surface,1600,900)
global.Dis_Xoffset=(global.MonitorW-1600)/2;
global.Dis_Yoffset=(global.MonitorH-900)/2;
}
//---------- Scale x 2.5 ------------------- // 27 inch monitors?
if(global.MonitorW>=2000 && global.MonitorH>=1125)
then
{
global.GameScale=2.5;
global.Scaling="On";
global.BlockScaling=false;
surface_resize(application_surface,2000,1125)
global.Dis_Xoffset=(global.MonitorW-2000)/2;
global.Dis_Yoffset=(global.MonitorH-1126)/2;
}
//---------- Scale x 3 ------------------- // projectors and huge tvs?
if(global.MonitorW>=2400 && global.MonitorH>=1350)
then
{
global.GameScale=3.0;
global.Scaling="On";
global.BlockScaling=false;
surface_resize(application_surface,2400,1350)
global.Dis_Xoffset=(global.MonitorW-2400)/2;
global.Dis_Yoffset=(global.MonitorH-1350)/2;
}
//---------- Scale x 3.5 -------------------
if(global.MonitorW>=2800 && global.MonitorH>=1575)
then
{
global.GameScale=3.5;
global.Scaling="On";
global.BlockScaling=false;
surface_resize(application_surface,2800,1575)
global.Dis_Xoffset=(global.MonitorW-2400)/2;
global.Dis_Yoffset=(global.MonitorH-1576)/2;
}
//---------- Scale x 4 ------------------- // 4k baby!
if(global.MonitorW>=3200 && global.MonitorH>=1800)
then
{
global.Scaling="On";
global.GameScale=4.0;
global.BlockScaling=false;
surface_resize(application_surface,3200,1800)
global.Dis_Xoffset=(global.MonitorW-3200)/2;
global.Dis_Yoffset=(global.MonitorH-1800)/2;
}
// ------------------------------ PAUSE BACKGROUND SCALE -------------------------------------
switch (global.GameScale) // if game is on Engine scaling -- size of pause backbrounds
{
case 1.0:
global.PauseBack=1;
break;
case 1.5:
global.PauseBack=0.67;
break;
case 2.0:
global.PauseBack=0.5;
break;
case 2.5:
global.PauseBack=0.4;
break;
case 3.0:
global.PauseBack=0.33;
break;
case 3.5:
global.PauseBack=0.27;
break;
case 4.0:
global.PauseBack=0.25;
break;
}
//------------------------------ GAME LANGUAGE ------------------------------------------
/*
if(os_get_language()=="fr")
then
{
global.Francais=true; // to know if the game is played in french or english
global.CurrentLanguage="Français"; // to know which language the game is currently in
}
else
{*/
global.Francais=false;
global.CurrentLanguage="English";
//}
//----------------------------------- OTHER SETTINGS --------------------------------------
caption_score=false; // prevents score being displayed in the windows border
window_set_caption("The Life Ruby"); // what the window itself is named
window_set_cursor(cr_none); // to remove mouse cursor
window_center(); // centers the window in the monitor
global.WindowStyle="Full"; // by default the window style is "fullscreen"
global.CurrentZone=GameSetting; // so the game knows which zone we are in
global.Version=500; // to know wich version of the game
//instance_create(10,10,obj_OLDTVFilter_PresetBase); // for CRT shader
room_goto_next();
thanks for the feedback! I'll read your tutorial and test ir right nowI am having troubles with the shader.
I guess I should have been in the beta testing. Just dropping it into my game messes things up pretty bad:
1- if the base object is created before my initial settings, it messes my transitions and at the second transition my game makes, it just stops working. Certain of my messages also appear on top!
2 - If I create the object after my initial settings are done, it still messes the transitions and it doesn't appear at the right size either.
I am not grasping what do I have to do in order to make this work. I hope can help me (or anyone that is).
My game doesn't use the GUI layer for one thing. I don't think it matters much. It DOES use the application surface though. It needs to work with both the application surface ON and OFF because I have an option toggle it on/off. My transition object is drawing the application surface in a Post Draw event and the transition itself in simply a rectangle drawn on top of everthing with its alpha gradually changing. For scaling my game I use the method I am describing in my tutorial here (pixel perfect method): https://forum.yoyogames.com/index.php?threads/how-to-properly-scale-your-game.995/
If this messes your shader, this means my tutorial is messing up alot of your clients....
Lastly, this is what I have in my ini room:
Code://-------------------------------- GAME SCALING ---------------------------- show_debug_overlay(0); // shows some debug info on screen like memory use, texture swaps, etc REMOVE FOR RELEASE!! texture_set_interpolation(false); // prevent any interpolation on images global.Interpolation=false; // to track its on or off display_reset(0,true); // sets the anti-aliasing off (0) and vsync on (true) global.Vsync=true; // to track when the v-sync is on/off global.Frameskip=true; // game starts with frameskip debug code off global.AppSurf=true; // to track if the application surface is in use or not application_surface_draw_enable(0); // so I can control the resize and drawing of the application surface draw_enable_alphablend(false); // disable the alpha blending of the application surface global.GameScale=1.0; // default (no scaling) global.Scaling="Off"; // to know if there's scaling going on or not global.BlockWindow=false; // to block the game in windowed mode global.BlockScaling=false; // to block the scaling option global.MonitorW=display_get_width(); // catching the size of the display global.MonitorH=display_get_height(); window_set_fullscreen(1); //play the game fullscreen surface_resize(application_surface,800,450) // size of the application surface for no scaling global.Dis_Xoffset=(global.MonitorW-800)/2; // set the position of the application surface global.Dis_Yoffset=(global.MonitorH-450)/2; //---------- Scale x 1.5 ------------------- if(global.MonitorW>=1200 && global.MonitorH>=675) // if the monitor's resolution is at least 1200x675... then { global.Scaling="On"; global.GameScale=1.5; // to track the scale generally speaking global.BlockScaling=false; surface_resize(application_surface,1200,675) // set the right application surface size global.Dis_Xoffset=(global.MonitorW-1200)/2; global.Dis_Yoffset=(global.MonitorH-676)/2; } //---------- Scale x 2 ------------------- if(global.MonitorW>=1600 && global.MonitorH>=900) // full HD! then { global.GameScale=2.0; global.Scaling="On"; global.BlockScaling=false; surface_resize(application_surface,1600,900) global.Dis_Xoffset=(global.MonitorW-1600)/2; global.Dis_Yoffset=(global.MonitorH-900)/2; } //---------- Scale x 2.5 ------------------- // 27 inch monitors? if(global.MonitorW>=2000 && global.MonitorH>=1125) then { global.GameScale=2.5; global.Scaling="On"; global.BlockScaling=false; surface_resize(application_surface,2000,1125) global.Dis_Xoffset=(global.MonitorW-2000)/2; global.Dis_Yoffset=(global.MonitorH-1126)/2; } //---------- Scale x 3 ------------------- // projectors and huge tvs? if(global.MonitorW>=2400 && global.MonitorH>=1350) then { global.GameScale=3.0; global.Scaling="On"; global.BlockScaling=false; surface_resize(application_surface,2400,1350) global.Dis_Xoffset=(global.MonitorW-2400)/2; global.Dis_Yoffset=(global.MonitorH-1350)/2; } //---------- Scale x 3.5 ------------------- if(global.MonitorW>=2800 && global.MonitorH>=1575) then { global.GameScale=3.5; global.Scaling="On"; global.BlockScaling=false; surface_resize(application_surface,2800,1575) global.Dis_Xoffset=(global.MonitorW-2400)/2; global.Dis_Yoffset=(global.MonitorH-1576)/2; } //---------- Scale x 4 ------------------- // 4k baby! if(global.MonitorW>=3200 && global.MonitorH>=1800) then { global.Scaling="On"; global.GameScale=4.0; global.BlockScaling=false; surface_resize(application_surface,3200,1800) global.Dis_Xoffset=(global.MonitorW-3200)/2; global.Dis_Yoffset=(global.MonitorH-1800)/2; } // ------------------------------ PAUSE BACKGROUND SCALE ------------------------------------- switch (global.GameScale) // if game is on Engine scaling -- size of pause backbrounds { case 1.0: global.PauseBack=1; break; case 1.5: global.PauseBack=0.67; break; case 2.0: global.PauseBack=0.5; break; case 2.5: global.PauseBack=0.4; break; case 3.0: global.PauseBack=0.33; break; case 3.5: global.PauseBack=0.27; break; case 4.0: global.PauseBack=0.25; break; } //------------------------------ GAME LANGUAGE ------------------------------------------ /* if(os_get_language()=="fr") then { global.Francais=true; // to know if the game is played in french or english global.CurrentLanguage="Français"; // to know which language the game is currently in } else {*/ global.Francais=false; global.CurrentLanguage="English"; //} //----------------------------------- OTHER SETTINGS -------------------------------------- caption_score=false; // prevents score being displayed in the windows border window_set_caption("The Life Ruby"); // what the window itself is named window_set_cursor(cr_none); // to remove mouse cursor window_center(); // centers the window in the monitor global.WindowStyle="Full"; // by default the window style is "fullscreen" global.CurrentZone=GameSetting; // so the game knows which zone we are in global.Version=500; // to know wich version of the game //instance_create(10,10,obj_OLDTVFilter_PresetBase); // for CRT shader room_goto_next();
Can someone help me figure out what's messing everything up?
nice, I'll check it! we had some resize issues on GMS2, but, not on 1.4...I am on lastest GMS 1.4
There is a setting in the shader called game_lines, I set that to my VERTICAL resolution for my game which is 540 (pixels)There some horrible banding in the scanlines. Is that meant to be? (see screenshot)
// Game resolution = 480x270
var gameScanlines = 0;
if display_get_height() == 1080
{ gameScanlines = 270; }
else if display_get_height() == 1050
{ gameScanlines = 262.5; }
else if display_get_height() == 1024
{ gameScanlines = 256; }
etc..
global.game_lines = gameScanlines;
You should add this marketplace link to the OP, so it's easier to spot. This looks great! I'm impressed.
dude, can i control when the effects showed and when it's not? like this room but this one not? or in this statement and this one not?as gamemaker store didn't create vouchers, you will need to get this gift on itch.io :3
https://vortexstudios.itch.io/old-t...load/wxCucEXWL9uGKxCjWToMl4YrR06WMpfFrs6Q8QHr
*are you a beta tester? remember, you will get a key on your email as a thanks for supporting the development