Gammon Forum
Entire forum
MUSHclient
Miniwindows
Easy auto-offset positioning
Easy auto-offset positioning
|
It is now over 60 days since the last post. This thread is closed.
  Refresh page
Posted by
| Larkin
(278 posts) bio
|
Date
| Fri 22 Jan 2010 02:18 AM (UTC) |
Message
| 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. | top |
|
Posted by
| Nick Gammon
Australia (22,989 posts) bio
Forum Administrator |
Date
| Reply #1 on Fri 22 Jan 2010 02:41 AM (UTC) |
Message
| 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 | top |
|
Posted by
| Larkin
(278 posts) bio
|
Date
| Reply #2 on Fri 22 Jan 2010 01:20 PM (UTC) |
Message
| 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... | 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.
11,836 views.
It is now over 60 days since the last post. This thread is closed.
  Refresh page
top
Quick links:
MUSHclient.
MUSHclient help.
Forum shortcuts.
Posting templates.
Lua modules.
Lua documentation.
Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.