Jump to content

[SOLVED] WidgetWindow isn't resized


photo

Recommended Posts

WidgetWindow isn't resized

UnigineScript


WidgetWindow exampleWin;



...



exampleWin.setWidth(100);

exampleWin.setHeight(100);

xml (User Interface file)


<window name="Test::exampleWin" width="100" height="100">

<text>exapmple</text>

</window>

Link to comment

This is a peculiar feature of a window. You can control its size only if you set parameter sizeable="1", but in this case user can control its size too.

Alternatively, you can use a widget container to control a window size.

 

string UI_PATH = "test/test6.ui";

Gui gui;
UserInterface ui;

WidgetVBox container;
WidgetWindow exampleWin;

/*
*/
int init() {
    gui = engine.getGui();
    ui = engine.gui.addUserInterface(gui,UI_PATH);

    container.setWidth(200);
    container.setHeight(400);

    gui.addChild(exampleWin);
    return 1;
}

 

<?xml version="1.0" encoding="utf-8"?>
<ui version="1.0">
    <window name="exampleWin" export="1" snap_distance="16">
         <text>exapmple</text>
         <vbox name="container" export="1" width="300" height="300"> </vbox>
    </window>
</ui>

Link to comment
  • 1 year later...
And you can lock the scale of one of the sides of the window, or change the size to the maximum value?

For example in a chat in horizontal window does not change size, but on the vertical of the possible.
Link to comment
  • 1 month later...
×
×
  • Create New...