# Toggling fullscreen

**URL:** <https://discourse.processing.org/t/toggling-fullscreen/44121>\
**Category:** Beginners\
**Created:** [March 19, 2024, 4:54pm UTC](https://discourse.processing.org/t/toggling-fullscreen/44121 "2024-03-19T16:54:55Z")\
**Posts on this page:** 1\
**Showing post:** 8

<div class="post-metadata">

**Author:** ![jafal](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jafal/32/19112_2.png) [@jafal](https://discourse.processing.org/u/jafal)\
**Post date:** [March 20, 2024, 7:40pm UTC](https://discourse.processing.org/t/toggling-fullscreen/44121/8 "2024-03-20T19:40:03Z")

</div>

Hi

> [@Processing resizing and changing sketch to and from fullScreen() mid sketch](https://discourse.processing.org/t/processing-resizing-and-changing-sketch-to-and-from-fullscreen-mid-sketch/24005):
>
> This might not sound useful but It took me a some time to get this working so I figured someone might find it useful. Here is the code to be able to resize the sketch and switch it to and from fullscreen while it is running: void setup(){ fullScreen(); surface.setResizable(false); surface.setAlwaysOnTop(true); } // Sets the x and y position of the screen aswell as the width and height void screen(int x, int y, int w, int h){ surface.setLocation(x, y); surface.setSize(w, h); } /…

> [@How do I switch between fullscreen and windowed during the sketch](https://discourse.processing.org/t/how-do-i-switch-between-fullscreen-and-windowed-during-the-sketch/13726):
>
> So as the title says, I want to create a button or something that I can click during a sketch to resize the window from fullscreen to different windowed resolutions like in a game. I’ve experimented with surface.setSize(), surface.setResizable(true) etc, but after a ton of googling I still can’t find a way to switch between windowed and fullscreen during the sketch. Is this a limitation of Processing or am I just missing something here? Any help is greatly appreciated

---

_[View the full topic](https://discourse.processing.org/t/toggling-fullscreen/44121)._
