K
KingRegicon
Guest
Hello, everyone!
I have been practicing GML for a few weeks now, and I'm really loving the problem-solving aspect of programming. The manual, online tutorials and GML forum posts have helped me through every problem I've faced so far, but now I must write my own post in desperation.
The Setup:
Two big "boxes" of stuff, sometimes drawn on top of each other (tall) and sometimes drawn next to each other (wide.)
The Dream:
I would like the game window itself to resize and fit both of these boxes perfectly- sometimes stacked vertically, sometimes situated horizontally, side by side.
I would like to be able to change my viewport / camera / etc. to toggle between these modes, all in code.
What is Working:
I have a boolean variable: "v_orient."
For debug purposes, I can currently toggle this on/off with my "Y" key.
If true, the game window sets its height and width to fit both boxes "vertically_oriented," as top and bottom.
If false, the game window sets its height and width to accommodate them horizontally, side by side.
What is NOT Working:
The way I've made the most progress so far is by changing the Properties *manually* in the room editor. (This is not ideal, of course.)
If I set viewport 0 to be tall, it won't display the horizontal configuration correctly- and vice-versa, if I set it to be wide.
The Code: (everything else was commented out, so I could see which parts are even having an effect.)
(STEP EVENT)
^^^ written in a script that runs on the "step" event, on a game object that persists across rooms.
(CREATE EVENT)
^^^ written in a script that runs on the "create" event, on a game object that persists across rooms.
I've commented out all of my code- except the lines above- to see which lines were having an effect at all. (I tried a lot of tutorials.) Disappointingly, almost none of them did. I am now forced to admit that I have *no idea* what is required for a working viewport setup- the variables, functions, cameras, etc.
If anyone could help me understand which parts of the system I need to implement, I would appreciate it!
Thanks!
I have been practicing GML for a few weeks now, and I'm really loving the problem-solving aspect of programming. The manual, online tutorials and GML forum posts have helped me through every problem I've faced so far, but now I must write my own post in desperation.
The Setup:
Two big "boxes" of stuff, sometimes drawn on top of each other (tall) and sometimes drawn next to each other (wide.)
The Dream:
I would like the game window itself to resize and fit both of these boxes perfectly- sometimes stacked vertically, sometimes situated horizontally, side by side.
I would like to be able to change my viewport / camera / etc. to toggle between these modes, all in code.
What is Working:
I have a boolean variable: "v_orient."
For debug purposes, I can currently toggle this on/off with my "Y" key.
If true, the game window sets its height and width to fit both boxes "vertically_oriented," as top and bottom.
If false, the game window sets its height and width to accommodate them horizontally, side by side.
What is NOT Working:
The way I've made the most progress so far is by changing the Properties *manually* in the room editor. (This is not ideal, of course.)
If I set viewport 0 to be tall, it won't display the horizontal configuration correctly- and vice-versa, if I set it to be wide.
The Code: (everything else was commented out, so I could see which parts are even having an effect.)
(STEP EVENT)
^^^ written in a script that runs on the "step" event, on a game object that persists across rooms.
(CREATE EVENT)
^^^ written in a script that runs on the "create" event, on a game object that persists across rooms.
I've commented out all of my code- except the lines above- to see which lines were having an effect at all. (I tried a lot of tutorials.) Disappointingly, almost none of them did. I am now forced to admit that I have *no idea* what is required for a working viewport setup- the variables, functions, cameras, etc.
If anyone could help me understand which parts of the system I need to implement, I would appreciate it!
Thanks!
Last edited by a moderator: