楼主: 气味123

[已经过期] 怎么显示金钱窗口啊

  [复制链接]
梦石
0
星屑
75
在线时间
107 小时
注册时间
2009-11-3
回帖
241
发表于 2009-11-9 22:03:03 | 显示全部楼层
貌似很深奥的东西
显示在那里干什么的?
回复

使用道具 举报

永遠神剣

梦石
0
星屑
334
在线时间
412 小时
注册时间
2009-8-16
回帖
1765

贵宾

发表于 2009-11-10 00:41:01 | 显示全部楼层
本帖最后由 Eienshinken 于 2009-11-10 00:42 编辑
  1. # 设置项目==========================================
  2. module Eienshinken
  3. #开关编号
  4. VAR = 1
  5. #窗口显示的字符
  6. STRING = "金币"
  7. end
  8. #===================================================

  9. class Scene_Map
  10.   alias qiwei_main main
  11.   def main
  12.     @gg = Window_Variables.new
  13.     @gg.x = 640 - @gg.width
  14.     @gg.y = 480 - @gg.height
  15.     @gg.opacity = 120
  16.     qiwei_main
  17.     @gg.dispose
  18.   end
  19.   alias shuaxin_update update
  20.   def update
  21.     shuaxin_update
  22.     @gg.update
  23.   end
  24. end
  25. #==============================================================================
  26. # ■ Window_Variables
  27. #------------------------------------------------------------------------------
  28. #  显示某变量的窗口。
  29. #==============================================================================

  30. class Window_Variables < Window_Base
  31.   #--------------------------------------------------------------------------
  32.   # ● 初始化窗口
  33.   #--------------------------------------------------------------------------
  34.   def initialize
  35.     super(0, 0, 160, 64)
  36.     self.contents = Bitmap.new(width - 32, height - 32)
  37.     @variables = $game_variables[Eienshinken::VAR]
  38.     refresh
  39.   end
  40.   #--------------------------------------------------------------------------
  41.   # ● 刷新
  42.   #--------------------------------------------------------------------------
  43.   def refresh
  44.     self.contents.clear
  45.     cx = contents.text_size($game_variables[Eienshinken::VAR].to_s).width
  46.     self.contents.font.color = normal_color
  47.     self.contents.draw_text(4, 0, 120-cx-2, 32, $game_variables[Eienshinken::VAR].to_s, 0)
  48.     self.contents.font.color = system_color
  49.     cx = contents.text_size("#{Eienshinken::STRING}").width
  50.     self.contents.draw_text(124-cx, 0, cx, 32, "#{Eienshinken::STRING}", 2)
  51.   end
  52.   def update
  53.     super
  54.     if  @variables != $game_variables[Eienshinken::VAR]
  55.       refresh
  56.     end
  57.   end
  58. end

复制代码
新的UI 旧的开始
回复

使用道具 举报

梦石
0
星屑
55
在线时间
76 小时
注册时间
2009-10-24
回帖
109
 楼主| 发表于 2009-11-12 12:30:22 | 显示全部楼层
我说的是金钱变量1都显示出来
回复

使用道具 举报

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

本版积分规则

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

在本版发帖返回顶部