Page 1 of 1

MGUI View Editing?

Posted: Sat Nov 17, 2012 2:16 pm
by Drnkhobo
Hey all, ive been designing a nice menu system I want to implement in a proj
that basically pops out when u rclick on a certain part of the gui.

My question is , can you dynamically re size mgui's?
So when u rclick, another module's gui resizes form 0,0 to 15,15 or whatever.

Can this be done? I searched the SM forums with no luck.
I checked in the docs and didnt find anything other than changing it by manually
resizing the mgui. Anyone done this or anything similar?

I know i can switch gui's on/off so maybe I just need to mess around with that?
EDIT: Managed to get it by delaying gui switches, but still not the best.
peace

Re: MGUI View Editing?

Posted: Sat Nov 17, 2012 7:22 pm
by Drnkhobo
I managed to move the MGUI left and right (in/out) of the view area.
Not a total fix but it will do, was as easy as changing the MGUI's XY

Re: MGUI View Editing?

Posted: Sun Nov 18, 2012 10:36 am
by trogluddite
Hi there,
The answer is kind of yes and no!
The MGUI size of each module is totally decided by the size of the module as you see it in the editing window - so in that sense, once you have exported your plugin, view sizes will remain fixed.
However, there's nothing to stop you making a module panel bigger than you really need it to be, and then only drawing on part of it. This could be used to give the appearance of a resizable window.

You will need to be careful with your active mouse areas when you do this, though - if you have one 'window' layered on top of another, you can sometimes still edit controls that are hidden beneath the top window. That's because mouse events get eaten up by an active control, but parts of the panel with no active control will allow the mouse events to "fall through" into modules that are underneath.
You can get around this by putting "dummy" mouse handlers in the module that use the entire area of the 'floating window' - you don't have to program them to actually do anything, they're just there to "soak up" the mouse events so that your top window has "focus".