FMOD Studio scripting API - Set fixed dialog window size : no resizing

Hi,

I want to make a simple tool for FMOD Studio. And I want that my dialogue window to not change size, but sizepolicy doesn’t work on the dialog window.

Thanks,

   studio.menu.addMenuItem({ 
    name: "***\\****",
    keySequence: "Ctrl+I",
   execute: function() {
    studio.ui.showModelessDialog({
        windowTitle: "*****",
        windowWidth: 600,
        windowHeight: 100,
        widgetType: studio.ui.widgetType.Layout,
        layout: studio.ui.layoutType.VBoxLayout,
        contentsMargins: { left: 0, top: 0, right: 0, bottom: 0 },
        sizePolicy: { horizontalPolicy: studio.ui.sizePolicy.Fixed, 
                      verticalPolicy: studio.ui.sizePolicy.Fixed },
        spacing: 10,

windowWidth and windowHeight are working fine for me in the latest version of FMOD Studio. What version are you using?
Does it work if you change the window width and height inside the existing EngineDesigner.js example script? i.e

studio.menu.addMenuItem({
    name: "FMOD Examples\\Engine Designer",
    keySequence: "Ctrl+Shift+E",
    execute: function() {
    
        var sliderResolution = 10000;
        
        studio.ui.showModelessDialog({
            windowTitle: "Engine Designer",
+           windowWidth: 900,
+           windowHeight: 900,
            widgetType: studio.ui.widgetType.Layout,
            layout: studio.ui.layoutType.VBoxLayout,
            spacing: 12,
            items: [
...

Hi,
I’m using an older version. I’m using FMOD 2.02.06.
Yeah, windowHeight and windowWidth work fine, but is there a way to disable the resizing of the main window, so that the windowHeight and windowWidth are fixed?

thanks.

I see what you mean now- sizePolicy doesn’t appear to be working correctly. I have passed this onto the Dev team to investigate, thank you for flagging!

1 Like

After consulting with the develpment team, it turns out that window size policy only relates to the contents of the window and not the window itself, so setting the size policy will not affect whether the dialogue window itself can resize. The documentation on this was recently revised with this point ui.sizePolicy, and it looks like there is no way to set a fixed window size unfortunately.

1 Like