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

Project1

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

[已发主站] [新手教程]怎么添加菜单背景

[复制链接]

Lv1.梦旅人

梦石
0
星屑
48
在线时间
543 小时
注册时间
2011-6-25
帖子
441
1
发表于 2012-5-19 10:08:07 | 显示全部楼层
本帖最后由 poiuy12348609 于 2012-5-19 15:56 编辑

请问
RGSS 代码复制
  1. #encoding:utf-8
  2. #==============================================================================
  3. # ■ Window_MenuStatus
  4. #------------------------------------------------------------------------------
  5. #  菜單畫面中,顯示隊伍成員狀態的窗口
  6. #==============================================================================
  7.  
  8. class Window_MenuStatus < Window_Selectable
  9.   #--------------------------------------------------------------------------
  10.   # ● 定義實例變量
  11.   #--------------------------------------------------------------------------
  12.   attr_reader   :pending_index            # 保留位置(整隊用)
  13.   #--------------------------------------------------------------------------
  14.   # ● 初始化對象
  15.   #--------------------------------------------------------------------------
  16.   def initialize(x, y)
  17.     super(x, y, window_width, window_height)
  18.     @pending_index = -1
  19.     refresh
  20.   end
  21.   #--------------------------------------------------------------------------
  22.   # ● 獲取窗口的寬度
  23.   #--------------------------------------------------------------------------
  24.   def window_width
  25.     Graphics.width - 160
  26.   end
  27.   #--------------------------------------------------------------------------
  28.   # ● 獲取窗口的高度
  29.   #--------------------------------------------------------------------------
  30.   def window_height
  31.     Graphics.height
  32.   end
  33.   #--------------------------------------------------------------------------
  34.   # ● 獲取項目數
  35.   #--------------------------------------------------------------------------
  36.   def item_max
  37.     $game_party.members.size
  38.   end
  39.   #--------------------------------------------------------------------------
  40.   # ● 獲取項目的高度
  41.   #--------------------------------------------------------------------------
  42.   def item_height
  43.     (height - standard_padding * 2) / 4
  44.   end
  45.   #--------------------------------------------------------------------------
  46.   # ● 繪制項目
  47.   #--------------------------------------------------------------------------
  48.   def draw_item(index)
  49.     actor = $game_party.members[index]
  50.     enabled = $game_party.battle_members.include?(actor)
  51.     rect = item_rect(index)
  52.     draw_item_background(index)
  53.     draw_actor_face(actor, rect.x + 1, rect.y + 1, enabled)
  54.     draw_actor_simple_status(actor, rect.x + 108, rect.y + line_height / 2)
  55.   end
  56.   #--------------------------------------------------------------------------
  57.   # ● 繪制項目的背景
  58.   #--------------------------------------------------------------------------
  59.   def draw_item_background(index)
  60.     if index == @pending_index
  61.       contents.fill_rect(item_rect(index), pending_color)
  62.     end
  63.   end
  64.   #--------------------------------------------------------------------------
  65.   # ● 按下確定鍵時的處理
  66.   #--------------------------------------------------------------------------
  67.   def process_ok
  68.     super
  69.     $game_party.menu_actor = $game_party.members[index]
  70.   end
  71.   #--------------------------------------------------------------------------
  72.   # ● 返回上一個選擇的位置
  73.   #--------------------------------------------------------------------------
  74.   def select_last
  75.     select($game_party.menu_actor.index || 0)
  76.   end
  77.   #--------------------------------------------------------------------------
  78.   # ● 設置保留位置(整隊用)
  79.   #--------------------------------------------------------------------------
  80.   def pending_index=(index)
  81.     last_pending_index = @pending_index
  82.     @pending_index = index
  83.     redraw_item(@pending_index)
  84.     redraw_item(last_pending_index)
  85.   end
  86. end

要改在哪里???

点评

改了  发表于 2012-5-19 15:57
这个应该是决定光标位置的吧…… 是需要改什么?  发表于 2012-5-19 13:25


------------------------------------------我只放我看中的遊戲-----------------------------------------------
臉書:http://www.facebook.com/brian.lee.52643821
  音速君的論壇
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
48
在线时间
543 小时
注册时间
2011-6-25
帖子
441
2
发表于 2012-6-14 18:31:07 | 显示全部楼层


------------------------------------------我只放我看中的遊戲-----------------------------------------------
臉書:http://www.facebook.com/brian.lee.52643821
  音速君的論壇
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-5-22 21:58

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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