shaofywd 发表于 2010-8-20 14:30:15

mush中如何将几个mini window同时显示?

我写了几个mini window,分别用不同的函数调用,不过每次只能显示一个,其它的会自动隐藏,找了半天资料也没找到如何做的,根据官网的说法是可以同时显示的,不知道要如何设置啊?

zgbl 发表于 2010-8-20 14:35:08

坐等seagate,lzkd和ddid

killunix 发表于 2010-8-20 15:16:08

把他放到一个windowscreate里面

shaofywd 发表于 2010-8-20 15:41:01

这个我也试过,也没效果来着

killunix 发表于 2010-8-20 15:45:45

然后要画在不同的坐标上,你看看是不是一个把一个盖住了

shaofywd 发表于 2010-8-23 09:34:42

也不在同一个坐标上哇。
而且写在同一个create里的话,就违背我的初衷了,这样只能同一个函数来调用了吧

ddid 发表于 2010-8-23 20:38:29

上代码吧

maper 发表于 2010-8-23 21:11:52

win1 = "迷你windows1"-- 设定一个名字
WindowCreate (win1, 0, 0, 100, 100, 7, 0, ColourNameToRGB("white"))-- create window

win2 = "迷你windows2"-- 设定一个名字
WindowCreate (win2, 0, 0, 100, 100, 8, 0, ColourNameToRGB("red"))-- create window

win3 = "迷你windows3"-- 设定一个名字
WindowCreate (win3, 0, 0, 100, 100, 9, 0, ColourNameToRGB("green"))-- create window

测试
WindowShow (win1, 1)
WindowShow (win2, 1)
WindowShow (win3, 1)

WindowShow (win1, 0)
WindowShow (win2, 0)
WindowShow (win3, 0)
一切正常

ddid 发表于 2010-8-23 21:13:39

嗯嗯,maper 这个应该是正解了。

shaofywd 发表于 2010-8-23 22:39:55

function draw_status()
win = GetPluginID ()       
window_width = 330       
--window_height = 150       
window_height = 242
window_position = 6       
window_bg_color = ColourNameToRGB ("darkgray")
WindowFont (win, "f1", "Arial", 9)       
WindowFont (win, "f2", "Fixedsys",8)       

WindowCreate (win, 0, 0, window_width, window_height, window_position, 0, window_bg_color)

drawGauge(win, "f1", "精神", 5, 5, me.hp["rec_js"], me.hp["max_js"])
drawGauge(win, "f1", "精力", 5, 25, me.hp["rec_jl"], me.hp["max_jl"])
drawGauge(win, "f1", "气血", 5, 45, me.hp["rec_qx"], me.hp["max_qx"])
drawGauge(win, "f1", "内力", 5, 65, me.hp["rec_nl"], me.hp["max_nl"])
drawGauge(win, "f1", "食物", 5, 85, me.hp["rec_food"], me.hp["max_food"])
drawGauge(win, "f1", "饮水", 5, 105, me.hp["rec_water"], me.hp["max_water"])
w_text(win, "f1", "潜能", 5, 125, me.hp["pot"], "yellow")
w_text(win, "f1", "经验", window_width/2, 125, me.hp["exp"], "deeppink")
WindowShow (win, true)

end

function quest_status()
draw_status()
window_width = 330
window_height = 110
window_position = 7
window_bg_color = ColourNameToRGB ("white")

qst = GetPluginID()
WindowFont (qst, "f1", "Arial", 8)
WindowFont (qst, "f2", "Fixedsys", 8)
WindowFont (qst, "f3", "宋体", 12)

WindowCircleOp (qst, 2, 2 , 148, 0, 258, ColourNameToRGB("blue"), 6, 1, 0x000000, 1)
WindowCreate (qst, 0, 151, window_width, window_height, window_position, 0, window_bg_color)
WindowText (qst, "f1",
                "已完成 "..GetVariable("rec_quest").." 个任务,将要进行第 "..GetVariable("next_quest").." 个任务",
                10, 10, 0, 0,
                ColourNameToRGB ("green"),
                flase)

if GetVariable("rw_class") == "0" then
        rw_class = "任务"
elseif GetVariable("rw_class") == "1" then
        rw_class = "寻"
elseif GetVariable("rw_class") == "2" then
        rw_class = "要"
elseif GetVariable("rw_class") == "3" then
        rw_class = "杀"
elseif GetVariable("rw_class") == "4" then
        rw_class = "口讯"
elseif GetVariable("rw_class") == "5" then
        rw_class = "送"
else
        rw_class = "无定义"
end

local win_width = WindowTextWidth(qst, "f2", "["..rw_class.."]")
WindowText (qst, "f3",
                "["..rw_class.."] "..GetVariable("rw_item"),
                10, 35, 0, 0,
                ColourNameToRGB ("blue"),
                flase)
if rw_class == "送" then
        WindowText (qst, "f3",
                "[到] "..GetVariable("rw_npc"),
                150, 35, 0, 0,
                ColourNameToRGB ("red"),
                flase)
else
WindowText (qst, "f3",
                "[地点] "..GetVariable("rw_place"),
                150, 35, 0, 0,
                ColourNameToRGB ("red"),
                flase)
end

WindowText (qst, "f1",
                "当前经验",
                10, 55, 0, 0,
                ColourNameToRGB ("blue"),
                flase)
WindowText (qst, "f2",
                GetVariable("rec_exp"),
                80, 55, 0, 0,
                ColourNameToRGB ("red"),
                flase)
WindowText (qst, "f1",
                "新增经验",
                10, 75, 0, 0,
                ColourNameToRGB ("blue"),
                flase)
WindowText (qst, "f2",
                GetVariable("add_exp"),
                80, 75, 0, 0,
                ColourNameToRGB ("red"),
                flase)

WindowShow (qst, true)
end

这个是我的代码,定义了两个函数,当输入的是hp的时候调用的是function draw_status()
而输入的是quest的时候调用quest_status()这个函数,现在就是当输入hp时只显示draw_status()画的图,而quest_status()画的图隐藏,反之亦然。。。
页: [1] 2
查看完整版本: mush中如何将几个mini window同时显示?