北大侠客行MUD论坛

 找回密码
 注册
搜索
热搜: 新手 wiki 升级
楼主: littleknife

ddid前辈,请进。有个问题请教下。谢谢指点。

[复制链接]
发表于 2010-11-24 00:01:57 | 显示全部楼层


这个是我用 IUPLua 做的一个面板。个人感觉,IUPLua应该可以完成与你写的那个wxLua面板相同的功能。

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?注册

x
北大侠客行Mud(pkuxkx.com),最好的中文Mud游戏!
发表于 2010-11-24 12:25:28 | 显示全部楼层
好帖留名,以后有空了再来研究
北大侠客行Mud(pkuxkx.com),最好的中文Mud游戏!
发表于 2010-11-28 14:32:12 | 显示全部楼层
应你的要求,把上面例子的代码发出来。

希望对你有帮助。


  1. function iup_tabs_test()
  2. assert (package.loadlib ("iuplua51.dll", "luaopen_iuplua")) ()
  3. --assert (package.loadlib ("iupluaole51.dll", "luaopen_iupluaole")) ()
  4. assert (package.loadlib ("iupluacontrols51.dll", "luaopen_iupluacontrols")) ()

  5. -- Creates boxes
  6. vbox1 = iup.vbox{
  7.       iup.fill{},
  8.       iup.button{title = "NW", size = "35x35", action = "direction_nw()"},
  9.       iup.button{title="W", size = "35x35", action = "direction_w()"},
  10.       iup.button{title="SW", size = "35x35", action = "direction_sw()"},
  11.       iup.fill{} ;
  12.       gap = 12,
  13.      }
  14. vbox2 = iup.vbox{
  15.       iup.button{title = "Up", size = "30x20", action = "direction_up()"},
  16.       iup.button{title = "N", size = "35x35", action = "direction_n()"},
  17.       iup.button{title="Enter", size = "30x20", action = "direction_enter()"},
  18.       iup.button{title="Out", size = "30x20", action = "direction_out()"},
  19.       iup.button{title="S", size = "35x35", action = "direction_s()"},
  20.       iup.button{title = "Down", size = "30x20", action = "direction_down()"} ;
  21.       alignment = "ACENTER", gap = 5,
  22.      }
  23. vbox3 = iup.vbox{
  24.       iup.fill{},
  25.       iup.button{title = "NE", size = "35x35", action = "direction_ne()"},
  26.       iup.button{title="E", size = "35x35", action = "direction_e()"},
  27.       iup.button{title="SE", size = "35x35", action = "direction_se()"},
  28.       iup.fill{} ;
  29.       gap = 12,
  30.      }
  31. vboxA = iup.hbox{vbox1, vbox2, vbox3}
  32. vboxB = iup.vbox{
  33.       iup.label{title="此面板为空", expand="HORIZONTAL", alignment = "ACENTER"},
  34.       iup.button{title = "空白按钮", expand="HORIZONTAL", alignment = "ACENTER"},
  35.      }
  36.      
  37. -- Sets titles of the vboxes
  38. vboxA.tabtitle = "行走"
  39. vboxB.tabtitle = "动作"
  40. -- Creates tabs
  41. tabs = iup.tabs{vboxA, vboxB}
  42. -- Creates dialog
  43. dlg = iup.dialog{iup.vbox{tabs; margin="10x10"}; title="行动面板", size="165x230", resize = "NO", menubox = "YES", maxbox = "NO", minbox = "NO" }
  44. -- Shows dialog
  45. dlg:showxy(iup.RIGHT, iup.CENTER)
  46. print("dialog's show is finished.")
  47. --MainLoop
  48. if (iup.MainLoopLevel()==0) then
  49.     iup.MainLoop()
  50. end --if

  51. --以下代码,提供IUPLua从LUA中卸载的功能。
  52. dlg:destroy()
  53. iup.Close()
  54. print("IUPlua dialog is closed.")
  55. end -- iup_tabs_test()
  56. -- -- -- --
  57. function direction_nw()
  58. Send("nw")
  59. end --direction_nw()
  60. function direction_w()
  61. Send("w")
  62. end --direction_w()
  63. function direction_sw()
  64. Send("sw")
  65. end --direction_sw()
  66. function direction_up()
  67. Send("u")
  68. end --direction_sw()
  69. function direction_n()
  70. Send("n")
  71. end --direction_n()
  72. function direction_enter()
  73. Send("enter")
  74. end --direction_enter()
  75. function direction_out()
  76. Send("out")
  77. end --direction_out()
  78. function direction_s()
  79. Send("s")
  80. end --direction_s()
  81. function direction_down()
  82. Send("d")
  83. end --direction_d()
  84. function direction_ne()
  85. Send("ne")
  86. end --direction_ne()
  87. function direction_e()
  88. Send("e")
  89. end --direction_e()
  90. function direction_se()
  91. Send("se")
  92. end --direction_se()
复制代码
北大侠客行Mud(pkuxkx.com),最好的中文Mud游戏!
 楼主| 发表于 2010-11-28 20:55:57 | 显示全部楼层
谢谢!基本能取代wxlua,很好的东西!!
北大侠客行Mud(pkuxkx.com),最好的中文Mud游戏!
发表于 2010-11-28 21:37:07 | 显示全部楼层
呵呵~

nothank
北大侠客行Mud(pkuxkx.com),最好的中文Mud游戏!
发表于 2010-12-1 04:00:53 | 显示全部楼层
做按钮用mush自带的miniwindow跟hotspots就好了吧貌似,效果还很炫的,mush官方有详细教程。按钮有鼠标悬停鼠标滑过单击双击等各种反应动作,小窗口还能设置背景图片甚至有简单图像处理和合成的函数,Gammon那厮到底是作甚的...
北大侠客行Mud(pkuxkx.com),最好的中文Mud游戏!
发表于 2012-3-24 22:01:36 | 显示全部楼层
努力学习中
北大侠客行Mud(pkuxkx.com),最好的中文Mud游戏!
发表于 2012-8-4 01:37:10 | 显示全部楼层
1.lua和python有不可比拟的优势。至少在跨平台上。不然我当时就是写pyhell,不是helllua乐。
jarlyyn 发表于 2010-11-23 03:56 PM

    这句话何解? lua在跨平台上的优势真有那么大?
北大侠客行Mud(pkuxkx.com),最好的中文Mud游戏!
发表于 2014-4-8 15:51:12 | 显示全部楼层
学习一下
北大侠客行Mud(pkuxkx.com),最好的中文Mud游戏!
您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|手机版|小黑屋|北大侠客行MUD ( 京ICP备16065414号-1 )

GMT+8, 2024-5-19 02:39 AM , Processed in 0.009587 second(s), 13 queries .

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表