[Home] [Downloads] [Search] [Help/forum]

Gammon Forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  Miniwindows
. . -> [Subject]  Easy auto-offset positioning
Home  |  Users  |  Search  |  FAQ
Register forum user name
Forgotten password?

Easy auto-offset positioning

It is now over 60 days since the last post. This thread is closed.   [New subject]  Start a new subject   [Refresh] Refresh page

Posted by Larkin   (278 posts)  [Biography] bio
Date Fri 22 Jan 2010 02:18 AM (UTC)  quote  ]
I've been hunting through help files, plugins, and posts, but I haven't found a suitable answer yet. Basically, I have a background image in the lower left corner, and now I want to render various gauges on top of it at certain locations. Is there a convenient way to specify the coordinates such that the gauges are offset correctly from the corner?

I was hoping that the top/left would be translated to the bottom/left when I specified bottom-left positioning, but it seems now like absolute positioning is the only way to really accomplish this and that doesn't seem quite right, either.
[Go to top] top

Posted by Nick Gammon   Australia  (19,667 posts)  [Biography] bio   Forum Administrator
Date Reply #1 on Fri 22 Jan 2010 02:41 AM (UTC)  quote  ]
The auto-positioning will only really work with a single window. One approach would be to draw on top of that, by getting the background window's position using WindowInfo selectors 10 to 13, however that might conceivably be slightly behind, if all the windows are drawn at once.

What you probably need to do is work out from the background window's position (possibly forcing a repaint the very first time, as it won't have a position until the first refresh).

After that, use OnPluginWorldOutputResized to know when you need to recalculate (using absolute positions).

Or, on OnPluginWorldOutputResized simply get the output window's size, which should give you the lower edge for your other windows (the left obviously will be zero).

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Larkin   (278 posts)  [Biography] bio
Date Reply #2 on Fri 22 Jan 2010 01:20 PM (UTC)  quote  ]
Thanks for the advice. I've gotten my gauges where I want them now, except that they don't move when I resize. Now, I know I can use a plugin and catch the resizing event. However, the InfoBox module somehow avoids this and my gauges still move with my panel nicely. I can't quite figure out the trick to that, though. Too much code to go through...
[Go to top] top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


It is now over 60 days since the last post. This thread is closed.   [New subject]  Start a new subject   [Refresh] Refresh page

Go to topic:           Search the forum

[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.


Written by Nick Gammon - 5K

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( http://www.gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Web site powered by FutureQuest.Net]