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

Project1

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

[已经解决] 加入立绘后玩一会儿就自动退出游戏

[复制链接]

Lv4.逐梦者

梦石
0
星屑
6823
在线时间
1183 小时
注册时间
2015-8-15
帖子
691
跳转到指定楼层
1
发表于 2016-3-2 07:46:41 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式

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

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

x
RUBY 代码复制
  1. #==============================================================================
  2. # ■ Window_Character
  3. #------------------------------------------------------------------------------
  4. #  角色索引窗口
  5. #==============================================================================
  6.  
  7. class Window_Character < Window_Selectable
  8.   #--------------------------------------------------------------------------
  9.   # ● 初始化对像
  10.   #--------------------------------------------------------------------------
  11.   def initialize
  12.     super(0, 133, 800, 480)#(160, 84, 385, 480)
  13.     self.contents = Bitmap.new(width - 32, height - 32)
  14.     self.z += 10
  15.     self.opacity = HS::OPACITY
  16. #    self.contents.font.size = 20
  17.     @item_max = $game_party.actors.size
  18.    # @column_max = $game_party.actors.size
  19.     @column_max = 4
  20.     refresh
  21.   end
  22.   #--------------------------------------------------------------------------
  23.   # ● 刷新
  24.   #--------------------------------------------------------------------------
  25.   def refresh
  26.     self.contents.clear
  27.  
  28.  
  29.     for i in 0...$game_party.actors.size
  30.  
  31.     x =130 + i % 4 * (53 + 32)  # 根据包裹坐标修改过来的
  32.     y = 44 +  i / 4 * 128
  33.     actor = $game_party.actors[i]
  34.     bitmap = Bitmap.new ("Graphics/Status/" + actor.id. to_s + "_h") #RPG::Cache.character(actor.character_name, actor.character_hue)
  35.     cw = bitmap.width
  36.     ch = bitmap.height
  37.     src_rect = Rect.new(0, 0, cw, ch + 50)
  38.     self.contents.blt(x - ch , y - cw/ 2, bitmap, src_rect)
  39.  
  40.   end
  41.  
  42. end
  43.  
  44.  
  45.   #--------------------------------------------------------------------------
  46.   # ● 刷新光标矩形
  47.   #--------------------------------------------------------------------------
  48.   def update_cursor_rect
  49.     # 光标位置不满 0 的情况下
  50.     if @index <= - 1
  51.       self.cursor_rect.empty
  52.  
  53.       return
  54.     end
  55.  
  56.  
  57.  
  58.     # 获取当前的行
  59.     row = @index / @column_max
  60.     # 当前行被显示开头行前面的情况下
  61.     if row < self.top_row
  62.       # 从当前行向开头行滚动
  63.       self.top_row = row
  64.    end
  65.     # 当前行被显示末尾行之后的情况下
  66.     if row > self.top_row + (self.page_row_max - 1)
  67.       # 从当前行向末尾滚动
  68.       self.top_row = row - (self.page_row_max - 1)
  69.     end
  70.     # 计算光标的宽
  71.     cursor_width = 86
  72.     #cursor_width = 536 / (@column_max + 1) + 1  #光标大小
  73.     # 计算光标坐标
  74.  
  75.     x = 1 + @index % @column_max * (cursor_width - 1) - 6#光标位置调节 覆盖31行
  76.     y = @index / @column_max * 128 - self.oy - 3
  77.     # 更新国标矩形
  78.     self.cursor_rect.set(x+14, y+3, cursor_width, 123)#(x, y, cursor_width, 32)
  79.     refresh
  80.     draw_status
  81.  
  82.  
  83.     end
  84.  
  85.  
  86.   end
  87.     def draw_status
  88.     actor = $game_party.actors[@index]
  89.     bitmap = Bitmap.new ("Graphics/Status/" + actor.id. to_s + "_b")
  90.     src_rect = Rect.new(0, 0, bitmap.width, bitmap.height)
  91.     self.contents.blt(365 , 0, bitmap, src_rect,200)
  92. end

立绘.jpg (119.14 KB, 下载次数: 3)

立绘.jpg

评分

参与人数 1星屑 +35 收起 理由
RyanBern + 35 手动认可奖励

查看全部评分

Lv4.逐梦者

「Pemercyia」


Urhurrenna

梦石
0
星屑
9372
在线时间
2747 小时
注册时间
2008-9-5
帖子
3542

开拓者短篇八RM组冠军短篇九导演组亚军白银编剧

2
发表于 2016-3-2 22:56:44 | 只看该作者
本帖最后由 cinderelmini 于 2016-3-2 22:58 编辑
  1. #==============================================================================
  2. # ■ Window_Character
  3. #------------------------------------------------------------------------------
  4. #  角色索引窗口
  5. #==============================================================================

  6. class Window_Character < Window_Selectable
  7.   #--------------------------------------------------------------------------
  8.   # ● 初始化对像
  9.   #--------------------------------------------------------------------------
  10.   def initialize
  11.     super(0, 133, 800, 480)#(160, 84, 385, 480)
  12.     self.contents = Bitmap.new(width - 32, height - 32)
  13.     self.z += 10
  14.     self.opacity = HS::OPACITY
  15. #    self.contents.font.size = 20
  16.     @item_max = $game_party.actors.size
  17.    # @column_max = $game_party.actors.size
  18.     @column_max = 4
  19.     @old_index = self.index
  20.     refresh
  21.   end
  22.   #--------------------------------------------------------------------------
  23.   # ● 刷新
  24.   #--------------------------------------------------------------------------
  25.   def refresh
  26.     self.contents.clear
  27.     for i in 0...$game_party.actors.size
  28.       x = 130 + i % 4 * (53 + 32)  # 根据包裹坐标修改过来的
  29.       y = 44 +  i / 4 * 128
  30.       actor = $game_party.actors[i]
  31.       bitmap = Bitmap.new ("Graphics/Status/" + actor.id. to_s + "_h") #RPG::Cache.character(actor.character_name, actor.character_hue)
  32.       cw = bitmap.width
  33.       ch = bitmap.height
  34.       src_rect = Rect.new(0, 0, cw, ch + 50)
  35.       self.contents.blt(x - ch , y - cw/ 2, bitmap, src_rect)
  36.     end
  37.     draw_status
  38.     @old_index = self.index
  39.   end
  40.   
  41.   #--------------------------------------------------------------------------
  42.   # ● 描绘半身像
  43.   #--------------------------------------------------------------------------
  44.   def draw_status
  45.     actor = $game_party.actors[@index]
  46.     bitmap = Bitmap.new ("Graphics/Status/" + actor.id. to_s + "_b")
  47.     src_rect = Rect.new(0, 0, bitmap.width, bitmap.height)
  48.     self.contents.blt(365 , 0, bitmap, src_rect,200)
  49.   end
  50.   
  51.   #--------------------------------------------------------------------------
  52.   # ● 刷新光标矩形
  53.   #--------------------------------------------------------------------------
  54.   def update_cursor_rect
  55.     # 光标位置不满 0 的情况下
  56.     if @index <= - 1
  57.       self.cursor_rect.empty
  58.       return
  59.     end
  60.     # 获取当前的行
  61.     row = @index / @column_max
  62.     # 当前行被显示开头行前面的情况下
  63.     if row < self.top_row
  64.       # 从当前行向开头行滚动
  65.       self.top_row = row
  66.    end
  67.     # 当前行被显示末尾行之后的情况下
  68.     if row > self.top_row + (self.page_row_max - 1)
  69.       # 从当前行向末尾滚动
  70.       self.top_row = row - (self.page_row_max - 1)
  71.     end
  72.     # 计算光标的宽
  73.     cursor_width = 86
  74.     #cursor_width = 536 / (@column_max + 1) + 1  #光标大小
  75.     # 计算光标坐标

  76.     x = 1 + @index % @column_max * (cursor_width - 1) - 6#光标位置调节 覆盖31行
  77.     y = @index / @column_max * 128 - self.oy - 3
  78.     # 更新国标矩形
  79.     self.cursor_rect.set(x+14, y+3, cursor_width, 123)#(x, y, cursor_width, 32)
  80.    
  81.     refresh if @old_index != self.index
  82.   end

  83. end
复制代码

评分

参与人数 1梦石 +1 收起 理由
RyanBern + 1 认可答案

查看全部评分

回复 支持 反对

使用道具 举报

Lv4.逐梦者

梦石
0
星屑
6823
在线时间
1183 小时
注册时间
2015-8-15
帖子
691
3
 楼主| 发表于 2016-3-3 08:52:29 | 只看该作者
cinderelmini 发表于 2016-3-2 22:56

工程巨大感谢有你
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-6-29 17:16

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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