Jump to content

[SOLVED] InterfaceWindow


photo

Recommended Posts

Hey Unigine,

 

I realy can't get the understanding of how to use the "InterfaceWindow", I understand that the InterfaceWindow can be put out in unigine and moved arround on the whole OS.

 

I saw how it works in the "Interface-Demo" on your SDK, but thats it.

 

I can't understand how I can get this to my own ".ui" files or to generated dynamic GUI code.

 

I tried to search for the WidgetInterface.h to include it or something like this with no succeed.

I also tried to understand the "interface.cpp" but also with no success how this is working together.

 

So please would you be so kind and would prepare me a little demo with a .ui file and a dynamic code gui which i can drag arround on my OS?
So I could include this into our game.

Best regards & Thanks

 


Lars

Link to comment

Take look into the data/samples/interface/ and data/core/systems/widgets/ directories.

Unigine::Widgets can hide all InterfaceWindow related work.

 

InterfaceWindows is just a external window container for the Gui class.

You can place your Widgets inside it.

Link to comment

Hello Frustum,

thanks for you very fast feedback.

I already took a look into "data/samples/interface" but like i wrote i couldn't get into touch how its realy working.

void create_window(int flags,string title) {
InterfaceWindow window = new InterfaceWindow(flags,"core/gui/");
WidgetGroupBox groupbox = new WidgetGroupBox(window.getGui());
WidgetButton button = new WidgetButton(window.getGui(),title);
button.setCallback(GUI_CLICKED,"log.message",title + " clicked\n");
Gui(window.getGui()).addChild(groupbox,GUI_ALIGN_EXPAND);
groupbox.addChild(button,GUI_ALIGN_CENTER);
groupbox.setBackground(1);
window.setTitle(title);
window.setWidth(256);
window.setHeight(128);
window.setPosition(x,y);
window.setMouse(128,64);
window.setHidden(0);
windows.append(window);
x += 128;
y += 64;
}

 

e.g. this, there you create an "InterfaceWindow" which i tried to find but with no success.

 

 

 

And the Interface.h file which is incldued creates an "interface = new Interface("samples/interface/");" to this directory, i also tried this and it didn't work.

 

I realy can't get it how it should work and which settings i need to declarate to get it working.

Greetings

Lars

Link to comment

Update:

 

Some more tries:

 interface = new Interface("");

        // window
           using Unigine::Widgets;
        Window window = new Window("Unigine::Widgets::Window");
        window.setWidth(320);
        window.setHeight(240);
        window.setSizeable(1);
        window.setMoveable(1);


        // window
        window.arrange();
        addChild(window,ALIGN_OVERLAP | ALIGN_CENTER);

 

I tried this now, like it was in the "ui.cpp" without a ".ui" file to load cause we also got dynamic ui code, and the Window is still in the  frame and can't be dragged outside.

 

Is there any setting which i maybe need to enable aswell that all will work?

 

If i'm setting:  interface = new Interface(""); or  interface = new Interface(actualexecutepath); or NOTHING theres no difference at all.

 

Greetings

Lars

Link to comment

Sorry Frustum,

 

i don't understand "is interface plugin loaded", i searched through the forum/documentation about "interface plugin" before the first post but didn't find anything.


Wouldn't it be easier to provide a sample?
I think the code would just be 10 - 20 lines?

 

I don't know whats realy happening if i say "new Interface("myInterface/myPath")" what hes doing there and WHAT he's going to search then at all, like in the "Interface-Demo" done.

 

Greetings

Lars

Link to comment

Interface plugin must be loaded into the Engine.

You should run the engine with -extern_plugin "path/to/InterfacePlugin" command line argument.

After that each new InterfaceWindow class will create an external window.

 

Interface class is an internal class for Unigine samples only. This class creates a panel in the right-bottom corner with buttons.

Link to comment
×
×
  • Create New...