Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

[Resolved] Resize Viewport

Is there a way to resize a viewport that has already been created?
I've tried a few different things, none of them worked as I had hoped.

And yes, I am returning to scripting. At least for a bit. :D
 
I did a quick search through the game help file, and found that you can access the viewport's Rect data. So, I did a quick test, and found that that's how you resize a viewport. Try this:

Code:
viewport = Viewport.new(0, 0, 1, 1,)

viewport.rect = Rect.new(0, 0, 640, 480)

As you can see, the viewport will be resized if you modify its Rect data. Also, when will you be on? I've been waiting for you all day. We have work to do...
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top