Jump to content

[SOLVED] engine.console.run ( "video_restart" ) - don't updates rightly


photo

Recommended Posts

Hey Unigine,

 

in attachment you'll find a sample project to reproduce this error.

Error explanation:

If i try to change the video mode: 

engine.console.setInt( "video_mode", 3 );

And after this I restart the engine with: 

  engine.console.run ( "video_restart" );

The project is reloaded and the size of the frame is restartet but the problem is that:

engine.app.getWidth / engine.app.getHeight

Isn't updatet.

The width and height are just updated after a second press on the button which is attached, but not with the first one - which should be so?

 

I found a work around with trigger:

engine.console.run("world_reload");

But I realy don't know in which issues we run with this call, and at all the whole project is reloaded and not just the video.

A fast feedback and solution would be very good.

Thanks & Greetings

Lars

 

 

roa.rar

Link to comment

Hey Frustum,

thanks this worked for dynamic written "CENTER-My-Widget" code.

But if I add widgets like this:

gui.addChild ( box, GUI_ALIGN_OVERLAP | GUI_ALIGN_CENTER);

 

It isn't be centred at all.

If I run "world_reload" its going to be centred.
Any advice or do I realy need to calculate the center behind and set it with X/Y?

Greetings

Lars

Link to comment
  • 2 weeks later...

Hey necris,

 

thanks for Feedback.

No Problem at all, I did it at the moment with a workarround (calculating myself), but our gui is growing and growing and if those problems need to be handeld self in the code is just going to be blown up.

So all good - just wanted to stay tuned whats going on :)

Greetings

Lars

Link to comment

You call bottomTexture.setWidth(engine.app.getWidth()) function after gui.addChild(myHBox, GUI_ALIGN_OVERLAP | GUI_ALIGN_CENTER).

GUI_ALIGN_CENTER flag doesn't perform per-frame update of coordinates. This flag is used only inside Gui::addChild function for the first time positioning.

Link to comment

Hi Frustrum,

 

ok If the GUI_ALIGN_CENTER is just triggered in first time I understand this, but if we're restarting the VIDEO e.g. cause higher / lower resolution we completely dismiss the GUI and build it up anew.

So there should work the "GUI_ALIGN_CENTER" or am I'm wrong? (Cause this isn't working)

Thanks & Greetings

Lars

Link to comment

GUI_ALIGN_CENTER was designed for initial window placement.

It will be impossible to move windows with active per-frame widget centering.

You have to handle widgets positions in script manually.

Link to comment
×
×
  • Create New...