Jump to content

Search the Community

Showing results for tags 'widget'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • Welcome to UNIGINE Forums
    • News & Announcements
    • Getting started
  • Development
    • Content Creation
    • World Design
    • Rendering
    • Animation
    • Physics, Navigation and Path Finding
    • UI Systems
    • Sound & Video
    • Editor
    • C++ Programming
    • C# Programming
    • Networking
    • Sim IG (Image Generator)
    • VR Discussions
    • General
  • Improving UNIGINE
    • Documentation
    • Feeback for UNIGINE team
    • Bug Reports
    • Unigine SDK Beta feedback
  • Community
    • Collaboration
    • Tools, Plugins, Materials & Tutorials
    • Showcase
    • General Discussions
  • Legacy
    • UnigineScript

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...

Found 20 results

  1. [SOLVED] Widget: update sun position

    Hi, using the tutorials from the docs I have added a slider to the GuiSample in the VR Template. The tutorial goes on to adding a sun controlling method, but I cannot get it to work. I have added following code to the private section of GuiSample.h: WidgetSliderPtr slider; void slider_changed(); This to GuiSample::init in the GuiSample.cpp: slider = WidgetSlider::create(gui, 0, 360, 90); slider->setButtonHeight(200); slider->setPosition(250, 250); slider->setButtonWidth(200); gui->addChild(slider->getWidget(), Gui::ALIGN_OVERLAP); slider->setCallback0(Gui::CHANGED, MakeCallback(this, &GuiSample::slider_changed)); But have problems with the method changing the sun. void GuiSample::slider_changed() { ; } I tried following the tutorial, but the code crashes on the sun initialization everytime (last line), I get an exception // creating a world light and setting up its parameters thesun = LightWorld::create(Math::vec4(1.0f, 1.0f, 1.0f, 1.0f)); thesun->setName("Sun"); thesun->setDisableAngle(90.0f); thesun->setIntensity(1.0f); thesun->setScattering(LightWorld::SCATTERING_SUN); thesun->setWorldRotation(Math::quat(0.0f, 1.0f, 0.0f, 170.0f)); // passing node ownership to the editor thesun->release(); editor->addNode(thesun->getNode()); and I think that maybe this code just does not work with the component system. Could you please help me with the method changing sun position? And my second question: the slider appears and I can use it, but it is not active along its whole length - meaning, I can drag it only when I point to its right side. But when I drag it and let go, and want to manipulate it once again, lets say drag it back to its minimal position, it is active only on its left side ( so the slider moves, but the space where it can be grabbed seems to be constant; on the screenshots I have marked it with the mouse cursor). Last but not least: how can I change the size of the gui plane? Thanks!
  2. Create custom Widget element

    I have no idea, how to implement custom Widget element. In Qt i can do something like this: #include <QWidget> #include <QToolButton> #include <QLineEdit> #include <QSpacerItem> class CustomEditor : public QWidget { public: CustomEditor(QWidget *_parent = nullptr): QWidget(_parent) { m_btn = new QToolButton(this); m_btn->setText("Btn"); m_edit = new QLineEdit(this); QHBoxLayout *lt = new QHBoxLayout(this); setLayout(lt); lt->addWidget(m_edit); lt->addWidget(m_btn); } private: QToolButton *m_btn; QLineEdit *m_edit; }; And then use CustomEditor with layout manager or set for QTreeWidget, QTableWidget, QListWidget. But in Unigine i can't derive CustomEditor from Widget, in this case i must implement all of virtual functions. How i can implement complex ui element?
  3. C++ examples for Widget classes

    Hi community, the documentation for widget usages with c++ is not very big at the moment and most things I have to try by myself which is very time consuming because there are no examples. I hope this will get better. Currently I am stuck with WidgetHBox class. Can anybody tell me how to connect WidgetLabels to them with c++ code. A small example would be great. Thanks Sebastian
  4. [SOLVED] Qt integration with Unigine

    Hello everybody, we are planning a Project now with Qt Ui Elements on top of a Unigine Widget. We made a little research and found out that Qt is using a BackingStore to composite their UI Elements/Widgets (Labels, Buttons etc.). After calling winId() on a QWidget, the QWidget class creates a native HWND on Windows. When creating a OpenGL context with the HWND the rendered content is not blended correctly with the UI. Since Unigine uses the same technique with their AppQt example, we are wondering if you have any idea, how to do this. Or is there a solution to use a QOpenGLWidget instead of a QWidget? Thanks, Sebastian
  5. I'm attempting to render some lines onto a WidgetSpriteViewport using engine.visualizer.renderLine2D(). The documentation for the visualizer states that it draws it's 2D lines atop everything else. However, when rendering using renderLine2D the lines do not appear on top of any widgets drawn to the system GUI. Is this a bug? Thank you for your time, Andrew
  6. Hello, As I haven't found a standart class for tables in Unigine (something like “WidgetTable”), I decided to use undocumented class Unigine::Widget::Table defined in widget_table.h and used in examples and, apparently, in Editor's GUI. Now I face a problem: I can't change content in any of the table's boxes, exept the box in the first column of the given TableRow. Content of all boxes in the table, exept of the first column's box content, is passed to the table consrtuctor. Content of the first column is set by TableRow::setText(string) method. The other methods which seems to be what I need give unexpected result (for example, setValue(int) selects column in current row) or realize unevident mechanism with bit masks. Question: how to change content in the boxes by realized means? If it is not possible, I need advice in how to realize it.
  7. A bug with the order of events on the stack for GUI ... Gui gui = engine.getGui(); WidgetButton btn1 = new WidgetButton(gui, "Button 1"); btn1.setCallback( GUI_ENTER, "onEnter", 1 ); btn1.setCallback( GUI_LEAVE, "onLeave", 1 ); gui.addChild(btn1); WidgetButton btn2 = new WidgetButton(gui, "Button 2"); btn2.setCallback( GUI_ENTER, "onEnter", 2 ); btn2.setCallback( GUI_LEAVE, "onLeave", 2 ); gui.addChild(btn2); ... void onEnter( int id ) { log.message("onEnter( 'Button %d' )\n", id); } void onLeave( int id ) { log.message("onLeave( 'Button %d' )\n", id); } Please see the result in the attached picture. OrderEvent.rar
  8. I have a template interface elements (blank), I want to use it a few times <vbox name="canvas" export="1" /> <hbox name="blank" export="1"> <editline width="100"></editline> <button><text>OK</text></button> </hbox> WidgetVBox canvas; WidgetHBox blank; canvas.addChild( blank, GUI_ALIGN_EXPAND ); canvas.addChild( blank, GUI_ALIGN_EXPAND ); canvas.addChild( blank, GUI_ALIGN_EXPAND ); canvas.addChild( blank, GUI_ALIGN_EXPAND ); canvas.addChild( blank, GUI_ALIGN_EXPAND ); How to do it, tell me an option?
  9. [SOLVED] setFontPermanent

    Hey Unigine, I tried to call "setFontPermanent" on WidgetLabel, but log says: 12:26:02 path:111: Interpreter::parse_extern_class_begin(): unknown "WidgetLabel" class member "setFontPermanent" I'm using latest SDK. Documentation: https://developer.unigine.com/en/docs/1.0/code/scripting/library/gui/class.widget#setFontPermanent_int Could you please have a look? My .ui file: <label pos_y="5" align="overlap" name="serverStatus" export="1"><text>Offline</text></label> My .h file: serverStatus.setFontPermanent(-1); Greetings & Thanks Lars
  10. Hi all, it's trivial to fix and can save confusions. In the Unigine::Widgets there are two classes misnamed: Unigine::Widgets::Checkbox is Unigine::Widgets::CheckBox Unigine::Widgets::Combobox is Unigine::Widgets::ComboBox Best regards, Iván.
  11. Can I add a child WidgetVBox to a parent Unigine::Widgets::VBox? Example: Gui gui = engine.getGui(); WidgetVBox childVB = new WidgetVBox(gui); Unigine::Widgets::VBox parentVB = new Unigine::Widgets::VBox(); parentVB.addChild(childVB); // Error: Machine::do_callucfv(): "WidgetVBox 02e4f920 internal (12:21:21)" is not a user class If so, how?
  12. [SOLVED] Change skin for widget

    Hi how to specify for a particular widget to use another gui(skin) in the code. For example, for WidgetHSlider or WidgetCheckBox. Another question: how to create custom widgets, such as in the attachment. I've done with the fake. Created a slider, made ​​him empty texture (problem here - all sliders use this texture :) ), and top "nailed" widgetSprite. I looked at the source oil rush, there is a solution with the newly created widget_sprited. But to use "as is" I could not get, too many attachments drags. Question to unigine: What about the implementation of these widgets in the engine? That would be very cool! Thanks!
  13. Hey Unigine, stencil isn't working for sprites. <hbox stencil="1" width="10" export="1" name="statusbarLayer"> <sprite texture="imagepath.png"/> </hbox> If I'm using a label: <hbox stencil="1" width="10" export="1" name="statusbarLayer"> <label><text>012345678910111213</text></label> </hbox> it work's neither. (updated) In my opinion thats a bug isn't it? PS: I tried to set the align in texture like: align="expand" etc. and it didn't work aswell. Greetings Lars
  14. [SOLVED] Widgets - .UI - background="0"

    Hey Unigine, if I'm adding Editlines or edittext into my GUI .H-File and want to remove the background with -> background="0" It doesn't work: <editline export="0" background="0" width="500">YourMessage</editline> If I export the Widget and call function .setBackground(0) it works. At all: I thought the -> background="0" command could be wrong but with a button it works with no problems: <button background="0" width="100"><text>Send</text></button> PS: I'm using latest SDK. Greetings Lars
  15. Привет, об этом вопросе я уже писал https://developer.unigine.com/forum/topic/1692-error-or-not-event-button-higher-than-the-window/, но решение я так и не нашел. Подскажите, кто сталкивался и смог решить эту проблему. Как сделать так, чтобы не пролетали события у Widget-детей? Как добиться нормального работы WidgetVBox+WidgetSprite, схожей по работе с WidgetWindow? Спасибо. ===================== translation from google ===================== Hi, The question has long been https://developer.unigine.com/forum/topic/1692-error-or-not-event-button-higher-than-the-window/. But the decision, I did not find one. Help. How to make sure not to miss the event Widget-children? How to ensure the normal operation WidgetVBox + WidgetSprite, like WidgetWindow? Thank you.
  16. [SOLVED] 3D Windows in GUI

    Hey all, So I'd like to create a plugin that imitates behavior like that of the resource editor, whereby I have a series of tabs with 3D windows in them at Vector.zero. Not in my world, but an instanced 3d space whereby I can load and configure static mesh objects before they're loaded into the scene. Can a canvas widget object achieve this? Or will I end up using a PlayerSpectator in conjunction with controls?
  17. [SOLVED] Global Widget Styling

    Hello Unigine, could you please implement a global function in the Widget Class to set for each Widget e.g. the "Border"? Which will not be renderd by set widget.setBorder(0); e.g. Thanks and best regards Lars
  18. Привет! Может кто создавал подобное. Я хочу в интерфейсе (загруженный через *.ui файл) создавать динамические GUI элементы. Пример: Есть диалоговое окно, на котором будет вопрос WidgetLabel, а ниже несколько вариантов ответов (WidgetButton или WidgetSprite) варианты с WidgetListBox и WidgetMenuBox не надо. Спасибо! ===================== translation from google ===================== Hello! Who can create similar. I want to interface (loaded via *. Ui file) to create dynamic GUI elements. Example: There is a dialog box that will question WidgetLabel, but below are a few answers (WidgetButton or WidgetSprite) options with WidgetListBox and WidgetMenuBox not. Thanks!
  19. I'd like to create new sets of widget(i.e. WidgetInventory) via a plugin. Is it possible? If yes, how exactly can it be done? To make things clear, an Inventory Widget consists of let's say, 3 buttons, 1 listbox and a sprite. WidgetButton WidgetListBox WidgetSprite There, I need those Widgets to use inside the DLL Project using C++ via the C++ API and produce a plugin. In other words, I want to make a new WidgetInventory by using the default Widgets like WidgetButton in the form of a plugin.
  20. Hi, I want display unicode characters in WidthgetLabel. because i will service to asia. but i failed to display font. i attached error files.
  • Create New...