设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
查看: 1910|回复: 3
打印 上一主题 下一主题

[已经过期] 怎么把画面拉下去?

[复制链接]

Lv1.梦旅人

梦石
0
星屑
50
在线时间
83 小时
注册时间
2013-3-15
帖子
19
跳转到指定楼层
1
发表于 2014-1-17 17:50:15 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式

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

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

x
本帖最后由 18925880845 于 2014-1-17 17:52 编辑

本人是脚本新手,初学脚本,就学着改了一下游戏菜单。但是现在遇到了一个问题,这个问题困扰了我很久,还是想不到怎么解决,所以就来这里问前辈们。
如图 。怎么在选择到第4个角色的时候会把画面拉下去啊?脚本如下,请教该怎么改
  1. #==============================================================================
  2. # ■ Window_MenuStatus
  3. #------------------------------------------------------------------------------
  4. #  显示菜单画面和同伴状态的窗口。
  5. #==============================================================================

  6. class Window_MenuStatus < Window_Selectable
  7. #--------------------------------------------------------------------------
  8. # ● 初始化目标
  9. #--------------------------------------------------------------------------
  10. def initialize
  11. super(0, 0, 640, 480 - 68)
  12. self.contents = Bitmap.new(width - 32, 480)
  13. refresh
  14. self.active = false
  15. self.index = -1
  16. end
  17. #--------------------------------------------------------------------------
  18. # ● 刷新
  19. #--------------------------------------------------------------------------
  20. def refresh
  21. self.contents.clear
  22. @item_max = $game_party.actors.size
  23. for i in 0...$game_party.actors.size
  24. x = 64
  25. y = i * 116
  26. actor = $game_party.actors[i]
  27. draw_actor_graphic(actor, x - 40, y + 80)
  28. draw_actor_name(actor, x, y)
  29. draw_actor_class(actor, x + 144, y)
  30. draw_actor_level(actor, x, y + 32)
  31. draw_actor_state(actor, x + 90, y + 32)
  32. draw_actor_exp(actor, x, y + 64)
  33. draw_actor_hp(actor, x + 236, y + 32)
  34. draw_actor_sp(actor, x + 236, y + 64)
  35. end
  36. end
  37. #--------------------------------------------------------------------------
  38. # ● 刷新光标矩形
  39. #--------------------------------------------------------------------------
  40. def update_cursor_rect
  41. if [url=home.php?mod=space&uid=370741]@Index[/url] < 0
  42. self.cursor_rect.empty
  43. else
  44. self.cursor_rect.set(0, @index * 116, self.width - 32, 96)
  45. end
  46. end
  47. end
复制代码

Lv1.梦旅人

薄凉看客

梦石
0
星屑
50
在线时间
1269 小时
注册时间
2010-6-20
帖子
1316
2
发表于 2014-1-17 17:58:22 | 只看该作者
把self.contents = Bitmap.new(width - 32, 480)

改成
self.contents = Bitmap.new(width - 32, row_max * 116)
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
83 小时
注册时间
2013-3-15
帖子
19
3
 楼主| 发表于 2014-1-17 19:37:58 | 只看该作者
恋′挂机 发表于 2014-1-17 17:58
把self.contents = Bitmap.new(width - 32, 480)

改成

不行啊,按你这么改,下面三个人都会消失,只有第一个人没消失
回复 支持 反对

使用道具 举报

Lv1.梦旅人

薄凉看客

梦石
0
星屑
50
在线时间
1269 小时
注册时间
2010-6-20
帖子
1316
4
发表于 2014-1-17 21:00:05 | 只看该作者
  1. #==============================================================================
  2. # ■ Window_MenuStatus
  3. #------------------------------------------------------------------------------
  4. #  显示菜单画面和同伴状态的窗口。
  5. #==============================================================================

  6. class Window_MenuStatus < Window_Selectable
  7. #--------------------------------------------------------------------------
  8. # ● 初始化目标
  9. #--------------------------------------------------------------------------
  10. def initialize
  11. super(0, 0, 640, 480 - 68)
  12. self.contents = Bitmap.new(width - 32, 480)
  13. refresh
  14. self.active = false
  15. self.index = -1
  16. end
  17. #--------------------------------------------------------------------------
  18. # ● 刷新
  19. #--------------------------------------------------------------------------
  20. def refresh
  21. self.contents.clear
  22. @item_max = $game_party.actors.size
  23. for i in 0...$game_party.actors.size
  24. x = 64
  25. y = i * 140
  26. y = (i-3) * 140 if self.index == 3
  27. actor = $game_party.actors[i]
  28. draw_actor_graphic(actor, x - 40, y + 80)
  29. draw_actor_name(actor, x, y)
  30. draw_actor_class(actor, x + 144, y)
  31. draw_actor_level(actor, x, y + 32)
  32. draw_actor_state(actor, x + 90, y + 32)
  33. draw_actor_exp(actor, x, y + 64)
  34. draw_actor_hp(actor, x + 236, y + 32)
  35. draw_actor_sp(actor, x + 236, y + 64)
  36. end
  37. end
  38. #--------------------------------------------------------------------------
  39. # ● 刷新光标矩形
  40. #--------------------------------------------------------------------------
  41. def update_cursor_rect
  42. if self.index != @old_index
  43.   refresh
  44.   @old_index = self.index
  45. end
  46. if self.index < 0
  47. self.cursor_rect.empty
  48. else
  49. if self.index < 3
  50. self.cursor_rect.set(
  51. 0, self.index * 140, self.width / @column_max - 32, 96)
  52. else
  53. self.cursor_rect.set(
  54. 0, (self.index-3) * 140, self.width / @column_max - 32, 96)
  55. end
  56. end
  57. end
  58. end
复制代码
回复 支持 反对

使用道具 举报

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

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2024-9-30 15:24

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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