查看: 2221|回复: 1

[胡扯] 【胡扯】日常翻贴有助健康

[复制链接]
梦石
0
星屑
48
在线时间
784 小时
注册时间
2013-1-4
回帖
1057
发表于 2015-10-13 22:25:54 | 显示全部楼层 |阅读模式

加入我们,或者,欢迎回来。

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

×
本来是打算找个帖子,就去DK大大的空间乱翻。结果发现了几个神一样的古物。完全被吓坏了

第一个: WxRM
真被真被这玩意吓到了有木有。各种神奇和强大。

嗯,知道wxruby的就知道这是啥了
这是控件列表:
Frame
Sprite_FrameTitle
Widget
Button
Notebook
NotebookPage
NoteBookTab
Label
TextBox
ScrollBar
Spinner
Slider
CheckBox
ListBox
ComboBox
MenuBar
MenuMainElement
MenuList
WinBar
整个脚本支持鼠标和全键盘。
不过TextBox对输入法是没反应
脚本的作者真的很强大。。。。但是!!!这只能说是是一个纯技术人员的自娱自乐。因为这个在实际游戏开发中基本毫无用处。。。几乎所有的控件都是实时用一个像素点一个像素点画出来的囧。完全是在RM里实现了一套window下的GUI。
这是上边那个界面对应的脚本
  1. #==============================================================================
  2. # ** TestPage1
  3. #------------------------------------------------------------------------------
  4. #  A simple test Page
  5. #==============================================================================
  6. class TestPage1 < NotebookPage
  7.   def initialize(parent)
  8.     super(parent, 'Test1')
  9.     Button.new(self,16,16,120-32,96-24,'Click me') {p 'you did it'}
  10.     TextBox.new(self,140,16,120,24) {}
  11.     ScrollBar.new(self,width-18,2,height-34,height * 2,true,true) {}
  12.     Spinner.new(self,16,128,50,24)  {}
  13.     @scroll1 = Slider.new(self,16,160,100,20,0,100,false) {}
  14.     @scroll2 = Slider.new(self,126,100,20,100) {}
  15.     @label = Label.new(self,150,100,150,18,'',14,1,true)
  16.   end
  17.   
  18.   def update
  19.     super
  20.     return if !@label
  21.     @label.text = "#{@scroll1.value}-#{@scroll2.value}"
  22.   end
  23.   
  24. end  
  25. #==============================================================================
  26. # ** TestPage2
  27. #------------------------------------------------------------------------------
  28. #  A simple test Page
  29. #==============================================================================
  30. class TestPage2 < NotebookPage
  31.   def initialize(parent)
  32.     super(parent, 'Test2')
  33.     @ch1 = CheckBox.new(self,8,8,20,20) {}
  34.     Button.new(self,38,8,120,20,'Trigger CheckBox') {@ch1.active = !@ch1.active; Input.update}
  35.     ScrollBar.new(self,2,height-18,width-34,width * 2,false,true) {}
  36.   end
  37. end
  38. #==============================================================================
  39. # ** TestPage3
  40. #------------------------------------------------------------------------------
  41. #  A simple test Page
  42. #==============================================================================
  43. class TestPage3 < NotebookPage
  44.   def initialize(parent)
  45.     super(parent, 'Test3')
  46.     elements = [
  47.     "A",
  48.     "B",
  49.     "C",
  50.     "D",
  51.     "E",
  52.     "F",
  53.     "G",
  54.     "H"
  55.     ]
  56.     ListBox.new(self,8,8,150,160,elements) {}
  57.     ComboBox.new(self,180,8,116,20,elements) {}
  58.   end
  59. end
  60. #==============================================================================
  61. # ** TestPage4
  62. #------------------------------------------------------------------------------
  63. #  A simple test Page
  64. #==============================================================================
  65. class TestPage4 < NotebookPage
  66.   def initialize(parent)
  67.     super(parent, 'Test4')
  68.     @bar1 = WinBar.new(self,2,2,16,104,0,100,true)
  69.     @bar2 = WinBar.new(self,46,2,104,16,0,100,false)
  70.     @current = 0
  71.   end
  72.   
  73.   def update
  74.     super
  75.     if @current
  76.       @current += 1
  77.       @current %= 100
  78.       @bar1.current = @current
  79.       @bar2.current = @current
  80.     end  
  81.   end
  82.   
  83. end
  84. #==============================================================================
  85. # ** TestMenuList
  86. #------------------------------------------------------------------------------
  87. #  A text menu list
  88. #==============================================================================
  89. class TestMenuList < MenuList
  90.   def initialize(parent)
  91.     super(parent,0,22,150,24*3)
  92.     MenuMainElement.new(self,0,0,150,24,'New...',16,false) {select_listbox('new')}
  93.     MenuMainElement.new(self,0,24,150,24,'Open...',16,false) {select_listbox('open')}
  94.     MenuMainElement.new(self,0,48,150,24,'Exit',16,false) {exit}
  95.   end  

  96.   def select_listbox(value)
  97.     print("Choosed: #{value}")
  98.   end  
  99.   
  100. end
  101. #==============================================================================
  102. # ** TestMenuBar
  103. #------------------------------------------------------------------------------
  104. #  A simple Menu bar
  105. #==============================================================================
  106. class TestMenuBar < MenuBar
  107.   def initialize(parent)
  108.     super(parent,5,16,parent.width-10)
  109.     el1 = MenuMainElement.new(self,1,0,60,24,'File') {show_listbox}
  110.     el1.z = 450
  111.     MenuMainElement.new(self,61,0,60,24,'About',16,false) {show_about}
  112.     @menu_listbox = TestMenuList.new(el1)
  113.     @menu_listbox.visible = false
  114.     @menu_listbox.z = -1
  115.   end  
  116.   
  117.   def show_about
  118.     print("WxRM V 1.0\nCreador Por Ramiro.\nInspirado en WxRuby.")
  119.   end
  120.   
  121.   def show_listbox
  122.     @menu_listbox.visible = true
  123.     loop do
  124.       Graphics.update
  125.       Input.update
  126.       @menu_listbox.update
  127.       break if !@menu_listbox.visible
  128.     end
  129.     @menu_listbox.parent.triggered = false
  130.     update
  131.   end
  132.   

  133.   
  134.   
  135.   
  136. end

  137. #==============================================================================
  138. # ** Test Frame
  139. #------------------------------------------------------------------------------
  140. #  A simple Test Frame
  141. #==============================================================================
  142. class TestFrame < Frame
  143.   def initialize
  144.     super(nil,0,0,400,308,'Test window')
  145.     TestMenuBar.new(self)
  146.     @notebook = Notebook.new(self,8,48,384,250)
  147.     @notebook.add_page(TestPage1.new(@notebook))
  148.     @notebook.add_page(TestPage2.new(@notebook))
  149.     @notebook.add_page(TestPage3.new(@notebook))
  150.     @notebook.add_page(TestPage4.new(@notebook))
  151.   end
  152.   
  153.   def on_close
  154.     exit
  155.   end
  156.   
  157. end
复制代码

在多数几句。虽然这个代码实际使用价值不大,但却可以为RM内新的GUI开发提供极大地参考价值。(相必有不少人已经很厌烦RM里靠window来画GUI的囧况了)顺便一提的是,我本人正在为VA开发一套全新的GUI。之前在水区也发过相关的贴子(关于进度。。。之前有个可运行的版本,不过只是最早的一版,后来都是还没写到可运行就推翻重构了。。。前前后后大概重构了有5/6次囧。现在是核心部分差不多没问题了,剩下的就是几个控件的封装,也不是很麻烦。嗯,最主要的原因其实是懒吧233之前也有段时间【大概一两个月ORZ】基本没碰过ruby和RM。这次争取在十月底完成吧囧)。

然后是第二个:
Greenfish 世界地图生成器
然而可惜的是这个貌似有毒被取消掉了囧
看主楼的意思貌似是直接生成RM可用直接使用的地图
另外,有个生成奇幻世界的网站【 @蓝儿 大概是你之前说的那个?
因为之前水区的一篇和世界地图生成有关的帖子。正好最近找了不少过程生成随机地形之类的资料在看。。。。【顺便说一句昨天测试写了个高度图生成的脚本,结果生成的图片极其奇怪。。。ORZ

最后,貌似发现了DK大大的私人照QAQ【八卦之魂瞬间燃起

评分

参与人数 1星屑 +10 收起 理由
欧买歌 + 10 哦

查看全部评分

RM-GUI延期。。。最近被黑心老板压迫T_T
二次元少女的shitake,长着长脸,身高165,蓝色卷双马尾,FCUP,瞳色黑色,病气和御宅属性,是天才少女。

bluer
公主殿下

梦石
0
星屑
283
在线时间
533 小时
注册时间
2013-10-19
回帖
2017
发表于 2015-10-15 21:07:23 | 显示全部楼层
可能是这个orz
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部