本帖最后由 hahh 于 2013-10-31 11:51 PM 编辑
从论坛抄的一段画miniwindow的,为什么无论我把它设置在什么位置,他popup出来以后,都会自己挪动到屏幕右边中间的位置?
代码如下
function draw_task()
questinfo = GetVariable("questinfo");
info = split(questinfo,">");
-- use 8 pt Dina or 10 pt Courier
local fonts = utils.getfontfamilies ();
-- choose a font that exists
if fonts.Dina then
font_name = "Dina";
elseif fonts ["Lucida Sans Unicode"] then
font_name = "Lucida Sans Unicode";
else
font_size = 10;
font_name = "Courier";
end -- if
windowinfo = movewindow.install (infowin, 7, 0); -- get position (default to right/middle)
-- load fonts - mouseover window
WindowCreate (infowin, windowinfo.window_left,windowinfo.window_top,200,200,windowinfo.window_mode,windowinfo.window_flags,ColourNameToRGB "slategray")
-- install the fonts (49 is modern / fixed pitch)
WindowFont (infowin, font_id, font_name, font_size, false, false, false, false, 0, 49);
WindowFont (infowin, heading_font_id, font_name, font_size + 2, false, false, false, false, 0, 49);
-- NOW DISPLAY A WINDOW
-- what to say - one line per table entry, with imbedded colour codes
heading = "@Y任务列表: .";
left, top = 883,230;
align_right = false;
align_bottom = false;
capitalize = true;
-- show it
mw.popup (infowin, -- window name to use
heading_font_id, -- font to use for the heading
font_id, -- font to use for each line
heading, -- heading text
info, -- table of lines to show (with colour codes)
left, top, -- where to put it
border_colour, -- colour for round rectangle line
background_colour, -- colour for background
capitalize, -- if true, force the first letter to upper case
lign_right, -- if true, align right side on "Left" parameter
align_bottom) -- if true, align bottom side on "Top" parameter
--movewindow.add_drag_handler (infowin, 0, 0, 100, 100, 10); -- both-ways arrow cursor (10)
-- SAVE STATE in OnPluginSaveState
movewindow.save_state(infowin);
WindowShow(infowin,true)
end
北大侠客行MUD,中国最好的MUD |