Alright, I had given up on the MiniWindow thing for quite a while until the other day I decided to give it another go.
Thanks so much for your example here. Using it I've been able to get something very close to what I was looking for.
This is what I've got currently (it's set up as a timer as you suggested):
var = GetVariable ("target")
win = GetPluginID ( ) .. ":variable_contents"
font = "f"
name = "TargetWindow" .. GetPluginID ( )
WindowCreate ( win, 0, 0, 1, 1, miniwin.pos_bottom_center, 0, 0)
WindowFont ( win, font, "Courier", 6, true)
height = WindowFontInfo ( win, font, 1) + 10
width = WindowTextWidth ( win, font, var) + 10
WindowCreate ( win, 0, 0, 250, 25, miniwin.pos_bottom_center, 0, 0x333333)
WindowRectOp( win, miniwin.rect_draw_edge, 2, 2, -2, -2, miniwin.rect_edge_etched, miniwin.rect_edge_at_all)
WindowText ( win, font, "Current Target:", 5, 5, 0, 0, ColourNameToRGB ( "green" ) )
WindowText ( win, font, var, 150, 5, 0, 0, ColourNameToRGB ( "red" ) )
WindowShow ( win )
What I'm trying to do now is figure out how to manually set it's location instead of just using the generic top/bottom left/center/right function. I'm also a bit confused as to why there are two WindowCreates in there.
I've tried just adjusting the top and left values in the WindowCreate function, but it doesn't seem to do anything. And when I cut out the miniwin.pos it just returns an error every time it tries to draw the window.
Here's the window position at bottom_center:
http://s29.postimg.org/e0bp30sit/Mini_Window.jpg
It's offset quite a bit, I'm assuming because of the health bar plugin I've got installed. Though when I set it to Bottom_left it just dumps it right over the health bars.
Any advice?
Thanks in advance! |