Who could help me doing a Full screen toggle script

Hi,
I’m learning today that it’s possible. I saw the function here, it’s:

SetGPWindowFullScreen(fullScreen: Boolean )

Make the GP window be full screen or not fullscreen

Parameters

fullScreen (Boolean) –

image

But I have absolutely no skills in scripting… Anyone to help me?

Thanks in advance

Mat’

Here’s a script that will toggle fullscreen on and off from a button in the global rackspace.
I named the button widget FullSCR in the GP Script name(in Widget Properties, Advanced tab)

Var
   FullSCR : Widget // declaring the GP Script name from Widget Properties

On WidgetValueChanged(newValue : double) from FullSCR
    If newValue == 1.0 then SetGPWindowFullScreen(true) // this states that if the button turns on, fullscreen on
    Else SetGPWindowFullScreen(false)  // else if the button turns off, fullscreen off
    End
End
1 Like

Go through this basic example: How to control multiple parameters with a single widget?

And then try Edm11’s script :slight_smile:

1 Like

Ok, I tried but sorry, it didn’t work.
Any idea?

A Scriptlet does not know any Widget.
You have to create a Rackspace script.

The rackspace script was used in the example I posted above. That’s why I recommended to first try that example. :slight_smile:

As @edm11 recommended, use the global rackspace for this.

  • Add a switch widget to the global rackspace
  • Go to the ‘Advanced’ tab in the widget properties and enter the name “FullSCR” in the OSC/GPScript field.
  • Open the Global Rackspace Script Editor (Window menu)
  • Paste in the script posted above by @edm11 and click Compile.
  • Try out the widget

If you are a Mac user, the function SetGPWindowFullScreen is not the normal Mac fullscreen mode. Instead, replace it with SetGPWindowKioskMode.

Ok, thanks, I understand now where to paste scripts and how to recall it. It works now but it only minimize and maximize the window not full screen like Ctrl + Alt + F

Try this.

Ok everything works fine ! thanks a lot !
If it can be usefull, the final scripting is:

Var
   FullSCR : Widget // declaring the GP Script name from Widget Properties

On WidgetValueChanged(newValue : double) from FullSCR
    If newValue == 1.0 then SetGPWindowKioskMode(true) // this states that if the button turns on, fullscreen on
    Else SetGPWindowKioskMode(false)  // else if the button turns off, fullscreen off
    End
End

Thanks again !

This can be simplified to

Var
   FullSCR : Widget

On WidgetValueChanged(newValue : double) from FullSCR
   SetGPWindowKioskMode(newValue == 1.0) 
End