秀一下自制界面,mushclient
上面聊天窗口,右下角血槽,方向键和一些按钮,土是土了点{:7_279:}
北大侠客行MUD,中国最好的MUD 不错不错,自己动手总比拿来就用好! 回复 1# newflyaaaa
大佬 可以教下血条上面的方位按钮怎么做的吗?{:7_277:} 大佬不敢当,哈哈
就是用miniwindow自己画的
https://www.gammon.com.au/scripts/doc.php?general=miniwindows
每个按钮就是先画个方形,再上面画个字,然后再加个hotspot
用当前的出口做个trigger来更新按钮的字和hotspot。
有点麻烦就是哪个方向键画什么地方,我是左边放w,wu,wd,右边放e,eu,ed,然后中间是enter,out,up和down都是固定地方。 贴个按钮jscript代码吧:
function MBtn(win, idPrefix, text, active, ltrb) {
this.win = win;
this.idPrefix = idPrefix;
this.text = text;
this.active = active;
this.ltrb = ltrb;
this.getText = function() {
return this.text;
};
this.getHotspotId = function() {
return this.idPrefix + "_hs";
};
this.setLtrb = function(l,t,r,b) {
this.ltrb = ;
};
this.drawMe = function() {
var l = this.ltrb;
var t = this.ltrb;
var r = this.ltrb;
var b = this.ltrb;
var act = RECT_ACTION_SIMPLE;
var color1 =DARK_BLUE;
var color2 = DARK_BLUE;
if (this.active) {
act = RECT_ACTION_3D;
color1 = 5; //5 : Raised 6 : Etched 9 : Bump 10 : Sunken
color2 = 15; //0x03 (3) top left 0x06 (6) top right 0x09 (9) bottom left 0x0c (12) bottom right0x0f (15) rect
}
// black out previous draw
world.WindowRectOp(this.win, RECT_ACTION_FILL, l,t,r,b, BLACK,BLACK);
// Rect
world.WindowRectOp(this.win, act, l, t, r, b, color1, color2);
// Hotspot
world.WindowAddHotspot(this.win, this.getHotspotId(), l,t,r,b,
"", //BSTR MouseOver
"", // BSTR CancelMouseOver
"btnMouseDown", //BSTR MouseDown
"", //BSTR CancelMouseDown
"", //BSTR MouseUp
"", //BSTR TooltipText
1,//cursor_hand = 1
0 //Flags)
)
// Text
var txtH = world.WindowFontInfo(this.win, MFONT, 1);
var txtT = t + (b - t - txtH) / 2;
var txtW = world.WindowTextWidth(this.win, MFONT, this.text, false);
var txtL = l + (r - l - txtW) / 2;
world.WindowText(this.win, MFONT, this.text, txtL, txtT, r, b, GREEN, false);
}
}
回复 5# newflyaaaa
多谢(っ╹◡╹)ノ❀
页:
[1]