赞 | 1 |
VIP | 0 |
好人卡 | 0 |
积分 | 6 |
经验 | 71075 |
最后登录 | 2017-9-1 |
在线时间 | 1752 小时 |
Lv2.观梦者
- 梦石
- 0
- 星屑
- 575
- 在线时间
- 1752 小时
- 注册时间
- 2008-11-7
- 帖子
- 1431
|
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
- class Window_MapZ < Window_Base
- #--------------------------------------------------------------------------
- # ● 初始化对像
- #--------------------------------------------------------------------------
- def initialize
- super(0, 0, 640 ,480) #(-9, -9, 660 ,500)
- refresh
- end
- #--------------------------------------------------------------------------
- # ● 绘制值槽
- # rate : 比率(1.0 为满值)
- # color1 : 渐变色的左端
- # color2 : 渐变色的右端
- #--------------------------------------------------------------------------
- def draw_gauge(x, y, width, rate, color1, color2)
- fill_w = (width * rate).to_i
- gauge_y = y + line_height - 8
- contents.fill_rect(x, gauge_y, width, 30, gauge_back_color)
- contents.gradient_fill_rect(x, gauge_y, fill_w, 30, color1, color2)
- end
- #--------------------------------------------------------------------------
- # ● 刷新 contents.width
- #--------------------------------------------------------------------------
- def refresh
- self.contents.clear
- draw_pict_name = "界面01" # 要顯示的圖片名
- contents.blt(0, 0, Cache.picture(draw_pict_name), contents.rect)
-
- color1 = text_color(Freya::VariableColor1)
- color2 = text_color(Freya::VariableColor2)
-
- if $game_variables[Freya::MaxWindowVariableID] != 0
- rate = $game_variables[Freya::WindowVariableID].to_f / $game_variables[Freya::MaxWindowVariableID]
- draw_gauge(70, 355, 360, rate, color1, color2) #制作血槽
- text = "#{$game_variables[Freya::WindowVariableID]}/#{$game_variables[Freya::MaxWindowVariableID]}"
- draw_text(500,355,50,30 ,text, 2)
- else
- draw_text(contents.rect, $game_variables[Freya::WindowVariableID], 2)
- end
- draw_text(50,20,150,30, $game_system.variable_show_text,3) #事件脚本的调用
-
- change_color(text_color(3))
- self.contents.draw_text(360,187,50,32,$game_variables[$variables_a_id].to_s,3)
- self.contents.draw_text(360,215,50,32,$game_variables[$variables_a_id].to_s,3)
- self.contents.draw_text(360,240,50,32,$game_variables[$variables_a_id].to_s,3)
- self.contents.draw_text(360,268,50,32,$game_variables[$variables_a_id].to_s,3)
-
- change_color(text_color(3))
- self.contents.draw_text(505,187,50,32,$game_variables[$variables_aa_id].to_s,3)
- self.contents.draw_text(505,215,50,32,$game_variables[$variables_aa_id].to_s,3)
- self.contents.draw_text(505,240,50,32,$game_variables[$variables_aa_id].to_s,3)
- self.contents.draw_text(505,268,50,32,$game_variables[$variables_aa_id].to_s,3)
- change_color(text_color(0))
- end
- end
复制代码 还有 如何调用场景 最好 我用过好几个方法 都卡帧 |
|