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

Project1

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

游戏菜单窗口

 关闭 [复制链接]

Lv1.梦旅人

梦石
0
星屑
50
在线时间
13 小时
注册时间
2007-6-13
帖子
458
跳转到指定楼层
1
发表于 2007-8-2 01:53:55 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
我使用的是轩辕的美化菜单系统:以下发一段脚本(经过大量修改.)求各位高手们帮小弟再修改下,修改成当选择了某角色后才显示角色的头像和HP,SP,要没选择那就隐藏或透明掉.
脚本:
  1. #==============================================================================
  2. # ■ Window_MenuStatus
  3. #------------------------------------------------------------------------------
  4. #  显示菜单画面和同伴状态的窗口。
  5. #==============================================================================

  6. class Window_MenuStatus < Window_Selectable
  7.   #--------------------------------------------------------------------------
  8.   # ● 初始化目标
  9.   #--------------------------------------------------------------------------
  10.   def initialize
  11.     super(0, 0, 160, 352)#(0, 0, 160, 352)
  12.     self.contents = Bitmap.new(width - 32, height - 32)
  13.     refresh
  14.     self.active = false
  15.     self.index = -2
  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 = 30#64
  25.       y = 0#i * 160#80
  26.       actor = $game_party.actors[i]
  27.       bitmap = Bitmap.new("Graphics/System/menu/headp/" + actor.name + ".png")
  28.       #头像大小
  29.       src_rect = Rect.new(0, 0, 500, 500)#(0, 0, 42, 66)
  30.       self.contents.blt(x - 30, y + 10, bitmap, src_rect)#(x - 64, y + 10, bitmap, src_rect)
  31.       self.draw_actor_state(actor, x - 60, y + 34 + 17)#(actor, x - 60, y + 34 + 17)
  32.       # 我全写成散的!                  =。=
  33.       self.contents.font.color = normal_color
  34.       self.contents.font.size = 20#字体大小
  35.       #角色名坐标
  36.       self.contents.draw_text(x - 130, y, 120, 300, actor.name)#(x - 30, y, 120, 32, actor.name)
  37.       self.contents.font.color = system_color
  38.       self.contents.font.color = normal_color
  39.       self.contents.font.size = 18#16字体大小
  40.       self.contents.font.color = system_color
  41.       #HP坐标
  42.       self.contents.draw_text(x - 30, y + 535 + 17 , 32, 32, $data_system.words.hp)#(x - 30, y + 17 + 17, 32, 32, $data_system.words.hp)
  43.       self.contents.font.color = actor.hp == 0 ? knockout_color :
  44.         actor.hp <= actor.maxhp / 4 ? crisis_color : normal_color
  45.       self.contents.draw_text(x + 6, y + 135 + 17 +13, 32, 32, actor.hp.to_s, 2)#(x - 6, y + 17 + 17, 32, 32, actor.hp.to_s, 2)
  46.       self.contents.font.color = normal_color
  47.       self.contents.draw_text(x - 0 + 40, y + 135 + 17 +13, 12, 32, "/", 1)#(x - 26 + 48, y + 17 + 17, 12, 32, "/", 1)
  48.    
  49.       self.contents.draw_text(x + 0 + 56, y + 135 + 17 +13, 32, 32, actor.maxhp.to_s)
  50.       self.contents.font.color = system_color
  51.       #SP坐标
  52.       self.contents.draw_text(x - 30, y + 550 +17, 32, 32, $data_system.words.sp)#(x - 30, y + 34 +17, 32, 32, $data_system.words.sp)
  53.       self.contents.font.color = actor.sp == 0 ? knockout_color :
  54.         actor.sp <= actor.maxsp / 4 ? crisis_color : normal_color
  55.       self.contents.draw_text(x + 6, y + 150 + 17 +13, 32, 32, actor.sp.to_s, 2)#(x - 6, y + 34 + 17, 32, 32, actor.sp.to_s, 2)
  56.       self.contents.font.color = normal_color
  57.       self.contents.draw_text(x - 6 + 48, y + 150 + 17 +13, 12, 32, "/", 1)#(x - 26 + 48, y + 34 + 17, 12, 32, "/", 1)
  58.       self.contents.draw_text(x + 2 + 56, y + 150 + 17 +13, 32, 32, actor.maxsp.to_s)#(x - 24 + 56, y + 34 + 17, 32, 32, actor.maxsp.to_s)
  59.     end
  60.   end
  61.   #--------------------------------------------------------------------------
  62.   # ● 刷新光标矩形
  63.   #--------------------------------------------------------------------------
  64.   def update_cursor_rect
  65.     if @index <= -2
  66.       self.cursor_rect.empty
  67.     elsif @index == -1
  68.       self.cursor_rect.set(50, 0, self.width - 32, @item_max * 80)#(0, 0, self.width - 32, @item_max * 80)
  69.     else
  70.       self.cursor_rect.set(0, 0, 0, 0)#(0, @index * 80, self.width - 32, 80)
  71.     end
  72.   end
  73. end
复制代码


载图
空 憂 憂

Lv1.梦旅人

梦石
0
星屑
50
在线时间
13 小时
注册时间
2007-6-13
帖子
458
2
 楼主| 发表于 2007-8-2 01:53:55 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
我使用的是轩辕的美化菜单系统:以下发一段脚本(经过大量修改.)求各位高手们帮小弟再修改下,修改成当选择了某角色后才显示角色的头像和HP,SP,要没选择那就隐藏或透明掉.
脚本:
  1. #==============================================================================
  2. # ■ Window_MenuStatus
  3. #------------------------------------------------------------------------------
  4. #  显示菜单画面和同伴状态的窗口。
  5. #==============================================================================

  6. class Window_MenuStatus < Window_Selectable
  7.   #--------------------------------------------------------------------------
  8.   # ● 初始化目标
  9.   #--------------------------------------------------------------------------
  10.   def initialize
  11.     super(0, 0, 160, 352)#(0, 0, 160, 352)
  12.     self.contents = Bitmap.new(width - 32, height - 32)
  13.     refresh
  14.     self.active = false
  15.     self.index = -2
  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 = 30#64
  25.       y = 0#i * 160#80
  26.       actor = $game_party.actors[i]
  27.       bitmap = Bitmap.new("Graphics/System/menu/headp/" + actor.name + ".png")
  28.       #头像大小
  29.       src_rect = Rect.new(0, 0, 500, 500)#(0, 0, 42, 66)
  30.       self.contents.blt(x - 30, y + 10, bitmap, src_rect)#(x - 64, y + 10, bitmap, src_rect)
  31.       self.draw_actor_state(actor, x - 60, y + 34 + 17)#(actor, x - 60, y + 34 + 17)
  32.       # 我全写成散的!                  =。=
  33.       self.contents.font.color = normal_color
  34.       self.contents.font.size = 20#字体大小
  35.       #角色名坐标
  36.       self.contents.draw_text(x - 130, y, 120, 300, actor.name)#(x - 30, y, 120, 32, actor.name)
  37.       self.contents.font.color = system_color
  38.       self.contents.font.color = normal_color
  39.       self.contents.font.size = 18#16字体大小
  40.       self.contents.font.color = system_color
  41.       #HP坐标
  42.       self.contents.draw_text(x - 30, y + 535 + 17 , 32, 32, $data_system.words.hp)#(x - 30, y + 17 + 17, 32, 32, $data_system.words.hp)
  43.       self.contents.font.color = actor.hp == 0 ? knockout_color :
  44.         actor.hp <= actor.maxhp / 4 ? crisis_color : normal_color
  45.       self.contents.draw_text(x + 6, y + 135 + 17 +13, 32, 32, actor.hp.to_s, 2)#(x - 6, y + 17 + 17, 32, 32, actor.hp.to_s, 2)
  46.       self.contents.font.color = normal_color
  47.       self.contents.draw_text(x - 0 + 40, y + 135 + 17 +13, 12, 32, "/", 1)#(x - 26 + 48, y + 17 + 17, 12, 32, "/", 1)
  48.    
  49.       self.contents.draw_text(x + 0 + 56, y + 135 + 17 +13, 32, 32, actor.maxhp.to_s)
  50.       self.contents.font.color = system_color
  51.       #SP坐标
  52.       self.contents.draw_text(x - 30, y + 550 +17, 32, 32, $data_system.words.sp)#(x - 30, y + 34 +17, 32, 32, $data_system.words.sp)
  53.       self.contents.font.color = actor.sp == 0 ? knockout_color :
  54.         actor.sp <= actor.maxsp / 4 ? crisis_color : normal_color
  55.       self.contents.draw_text(x + 6, y + 150 + 17 +13, 32, 32, actor.sp.to_s, 2)#(x - 6, y + 34 + 17, 32, 32, actor.sp.to_s, 2)
  56.       self.contents.font.color = normal_color
  57.       self.contents.draw_text(x - 6 + 48, y + 150 + 17 +13, 12, 32, "/", 1)#(x - 26 + 48, y + 34 + 17, 12, 32, "/", 1)
  58.       self.contents.draw_text(x + 2 + 56, y + 150 + 17 +13, 32, 32, actor.maxsp.to_s)#(x - 24 + 56, y + 34 + 17, 32, 32, actor.maxsp.to_s)
  59.     end
  60.   end
  61.   #--------------------------------------------------------------------------
  62.   # ● 刷新光标矩形
  63.   #--------------------------------------------------------------------------
  64.   def update_cursor_rect
  65.     if @index <= -2
  66.       self.cursor_rect.empty
  67.     elsif @index == -1
  68.       self.cursor_rect.set(50, 0, self.width - 32, @item_max * 80)#(0, 0, self.width - 32, @item_max * 80)
  69.     else
  70.       self.cursor_rect.set(0, 0, 0, 0)#(0, @index * 80, self.width - 32, 80)
  71.     end
  72.   end
  73. end
复制代码


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

本版积分规则

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

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

GMT+8, 2026-6-30 21:23

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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