JadeMonsuta
Member
Yes I'm aware that it's not the best thing to have a view larger than a room, I've given my game a dynamic aspect ratio horizontally as means of better displaying the art created for it without distortion. It works properly so long as the room's width is equal to or greater than the width of the window, the smallest room would be 320 pixels wide and the largest window would be 640 pixels wide.
Pretext aside, I'm struggling to draw the room in the center of the screen, because for some reason it's aligned to the right of the screen.
While experimenting with it, I came across several interesting visual bugs.
Here it is drawing the game in all of the wrong places.
For some reason it's drawing the game multiple times, one correctly on the far left, then to the right of that a very glitchy display that flickers and only updates the frame it displays every few seconds. Then after that, a display of the game with the shaders applied twice, and to the right of that, the game without shaders.
Here is the code that handles the post processing, it's a script in a draw_gui event for the player:
Hastebin
Here's the code that handles the aspect ratio and the offset the room should be displayed at, it's in a begin step event in its own object:
Hastebin
The only possible "fixes" for this that I know how to program on my own are:
-Extending every room to meet the maximum size for the horizontal aspect ratio
-Limiting the maximum horizontal size
-Stretching the entire game to fit if the room is smaller than the view
Help would be greatly appreciated! I nearly came here for help on the aspect ratio code itself, but I was able to figure it out, but this has me completely stumped.
For anyone that comes across this post looking for code for a dynamic aspect ratio, feel free to use my code (even if it is kinda buggy, hence the existence of this thread), I think more games need this feature.
Pretext aside, I'm struggling to draw the room in the center of the screen, because for some reason it's aligned to the right of the screen.
While experimenting with it, I came across several interesting visual bugs.
Here it is drawing the game in all of the wrong places.
For some reason it's drawing the game multiple times, one correctly on the far left, then to the right of that a very glitchy display that flickers and only updates the frame it displays every few seconds. Then after that, a display of the game with the shaders applied twice, and to the right of that, the game without shaders.
Here is the code that handles the post processing, it's a script in a draw_gui event for the player:
Hastebin
Here's the code that handles the aspect ratio and the offset the room should be displayed at, it's in a begin step event in its own object:
Hastebin
The only possible "fixes" for this that I know how to program on my own are:
-Extending every room to meet the maximum size for the horizontal aspect ratio
-Limiting the maximum horizontal size
-Stretching the entire game to fit if the room is smaller than the view
Help would be greatly appreciated! I nearly came here for help on the aspect ratio code itself, but I was able to figure it out, but this has me completely stumped.
For anyone that comes across this post looking for code for a dynamic aspect ratio, feel free to use my code (even if it is kinda buggy, hence the existence of this thread), I think more games need this feature.