赞 | 0 |
VIP | 6 |
好人卡 | 0 |
积分 | 1 |
经验 | 12970 |
最后登录 | 2018-4-6 |
在线时间 | 166 小时 |
Lv1.梦旅人 幻想天神
- 梦石
- 0
- 星屑
- 55
- 在线时间
- 166 小时
- 注册时间
- 2012-3-24
- 帖子
- 404
|
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
本帖最后由 风若·飘絮 于 2013-5-20 21:26 编辑
- class Xiulian < Window_Base
-
- def initialize
- super(0, 0, 640, 480)
- self.contents = Bitmap.new(width - 32, height - 32)
- s1 = "提高气血"
- s2 = "提高魔法"
- s3 = "退出修炼"
- @command_window = Window_Command.new(180, [s1, s2, s3])
- @command_window.back_opacity = 100
- @command_window.x = 360 - @command_window.width / 2
- @command_window.y = 240
- @command_window.visible = true
-
-
- for i in 0...$game_party.actors.size
- x = 64
- y = i * 120
- actor = $game_party.actors[i]
- draw_actor_graphic(actor, 25, 120)
- draw_actor_name(actor, 100, y)
- #draw_actor_class(actor, x + 144, y)
- draw_actor_level(actor, 100, y+50)
- #draw_actor_state(actor, x + 90, y + 32)
- #draw_actor_exp(actor, x, y + 64)
- draw_actor_hp(actor,100, y+100)
- draw_actor_sp(actor,100, y+150)
-
- end
-
- cx = contents.text_size($data_system.words.gold).width
- self.contents.font.color = normal_color
- self.contents.draw_text(4, 0, 240, 32, $game_party.gold.to_s, 2)
- self.contents.font.color = system_color
- self.contents.draw_text(124-cx, 0, 260, 32,$data_system.words.gold, 2)
-
- # 执行过渡
- Graphics.transition
- loop do
- # 刷新游戏画面
- Graphics.update
- # 刷新输入信息
- Input.update
- # 刷新画面
- refresh
- # 如果画面被切换就中断循环
- if Input.trigger?(Input::L)
- break
- end
- end
- # 装备过渡
- #Graphics.freeze
- # 释放
- @command_window.dispose
- end
-
-
- def refresh
- #self.contents.clear
- #self.contents.draw_text(4, 0, 120-cx-2, 32, $game_party.gold.to_s, 2)
- @command_window.update
-
- # 按下 C 键的情况下
- if Input.trigger?(Input::C)
- # 命令窗口的光标位置的分支
- case @command_window.index
- when 0
- #command_new_game
- $game_party.actors[0].hp += 10
- self.contents.clear
- wenzishuaxin
- when 1
- #command_continue
- when 2
- #command_shutdown
- end
- end
- end
-
-
- def wenzishuaxin
- for i in 0...$game_party.actors.size
- x = 64
- y = i * 120
- actor = $game_party.actors[i]
- draw_actor_graphic(actor, 25, 120)
- draw_actor_name(actor, 100, y)
- #draw_actor_class(actor, x + 144, y)
- draw_actor_level(actor, 100, y+50)
- #draw_actor_state(actor, x + 90, y + 32)
- #draw_actor_exp(actor, x, y + 64)
- draw_actor_hp(actor,100, y+100)
- draw_actor_sp(actor,100, y+150)
- end
- cx = contents.text_size($data_system.words.gold).width
- self.contents.font.color = normal_color
- self.contents.draw_text(4, 0, 240, 32, $game_party.gold.to_s, 2)
- self.contents.font.color = system_color
- self.contents.draw_text(124-cx, 0, 260, 32,$data_system.words.gold, 2)
-
- end
-
- end
复制代码 写的很不规范,我想要的效果是,点击“提高气血”,HP就会提高10,并且会立刻刷新显示新的值
可是点击“提高气血”之后,刷新是刷新了,但是HP好像没提高 |
|