查看: 1966|回复: 2

[已经解决] 出战 字体这样才能显示在图片前面

[复制链接]
梦石
0
星屑
7306
在线时间
1244 小时
注册时间
2015-8-15
回帖
473
发表于 2016-2-11 14:44:31 | 显示全部楼层 |阅读模式

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

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

×
  1. #==============================================================================
  2. # ■ Window_MenuStatus
  3. #------------------------------------------------------------------------------
  4. #  显示菜单画面和同伴状态的窗口。
  5. #==============================================================================




  6. class Window_MenuStatus < Window_Selectable
  7.   #--------------------------------------------------------------------------
  8.   # ● 初始化对像
  9.   #--------------------------------------------------------------------------
  10.     def initialize(actor_index = 0, equip_index = 0)#def initialize(index = 0)
  11.     super(0, 64, 1200, 480)
  12.     @item_max = $game_party.actors.size
  13.     self.contents = Bitmap.new(width - 32, 400)
  14.     refresh
  15.    # self.active = index
  16.     self.index =  index
  17.    # equip_index =
  18.     @column_max = 4
  19.   end
  20.   #--------------------------------------------------------------------------
  21.   # ● 刷新
  22.   #--------------------------------------------------------------------------
  23.     def refresh

  24.     self.contents.clear


  25.    # @item_max = $game_party.actors.size
  26.     for i in 0...$game_party.actors.size
  27. #    draw_item(i, normal_color)
  28.   #  x = ( i + 1 ) * 92 +25
  29.   #  y = 44
  30. #    x = ( i + 1 ) % @column_max * (cursor_width + 1) - 4
  31. #   y = ( i + 1 ) / @column_max * 128 - self.oy
  32.    # x = 0 + index % 4 * (90 + 1) - 4
  33.   #  y = index / 90 * 128 - self.oy
  34.    # actor_width = 128
  35.     x =120 + i % 4 * (58 + 32)  # 根据包裹坐标修改过来的
  36.     y = 44 +  i / 4 * 128
  37.     actor = $game_party.actors[i]
  38.     bitmap = Bitmap.new ("Graphics/Status/" + actor.id. to_s + "_h") #RPG::Cache.character(actor.character_name, actor.character_hue)
  39.     cw = bitmap.width
  40.     ch = bitmap.height
  41.     src_rect = Rect.new(0, 0, cw, ch + 50)
  42.     self.contents.blt(x - ch , y  - cw/ 2, bitmap, src_rect) #src_rect
  43.     draw_actor_xdrs_lx(actor, x-ch, y)#转生次数

  44.         if i <= 3
  45.         self.contents.font.color = Color.new(255,255,0,255)
  46.         self.contents.draw_text(x + 200 , y ,160,32,"[出战]",999)
  47.         self.contents.font.color = normal_color
  48.         
  49.       else
  50.         self.contents.font.color = Color.new(128,128,128,255)
  51.         self.contents.draw_text(x ,y,160,32,"[休息]",999)
  52.         self.contents.font.color = normal_color
  53.   

  54.   end
  55.   end  
  56.   #   @item_max = $game_party.actors.size
  57.   #  if @item_max > 4
  58.    #   self.contents = Bitmap.new(width - 32, row_max * 32)
  59.    #   for i in 0...@item_max
  60.     #    raw_item(i, normal_color)
  61.     #  end
  62.   #  end
  63. end
  64. #
  65.   
  66.   #--------------------------------------------------------------------------
  67.   # ● 更新光标举行
  68.   #--------------------------------------------------------------------------


  69.   #--------------------------------------------------------------------------
  70.   # ● 项目无效化
  71.   #     index : 项目编号
  72.   #--------------------------------------------------------------------------
  73.   def disable_item(index)
  74.     draw_item(index, disabled_color)
  75.   end
  76.   #--------------------------------------------------------------------------
  77.   # ● 刷新光标矩形
  78.   #--------------------------------------------------------------------------



  79.   
  80. def update_cursor_rect
  81.     # 光标位置不满 0 的情况下
  82.     if @index <= - 1
  83.       self.cursor_rect.empty
  84.       
  85.       return
  86.     end
  87.     # 获取当前的行
  88.     row = @index / @column_max
  89.     # 当前行被显示开头行前面的情况下
  90.     if row < self.top_row
  91.       # 从当前行向开头行滚动
  92.       self.top_row = row
  93.    end
  94.     # 当前行被显示末尾行之后的情况下
  95.     if row > self.top_row + (self.page_row_max - 1)
  96.       # 从当前行向末尾滚动
  97.       self.top_row = row - (self.page_row_max - 1)
  98.     end
  99.     # 计算光标的宽
  100.     cursor_width = 90
  101.     #cursor_width = 536 / (@column_max + 1) + 1  #光标大小
  102.     # 计算光标坐标
  103.    
  104.     x = 0 + @index % @column_max * (cursor_width + 1) - 4 #光标位置调节 覆盖31行
  105.     y = @index / @column_max * 128 - self.oy
  106.     # 更新国标矩形
  107.     self.cursor_rect.set(x, y, cursor_width, 128)#(x, y, cursor_width, 32)
  108.   
  109.     end

  110. end
复制代码
出战.jpg
梦石
0
星屑
555
在线时间
111 小时
注册时间
2013-11-22
回帖
287
发表于 2016-2-12 00:00:06 | 显示全部楼层
推荐再写一个只有文字的window,然后在scene里调用,这样就方便调z值了
想在一个window里调这种图片和文字的遮挡关系,目前流年只能用这种方法
否则用精灵什么的很麻烦……
回复

使用道具 举报

梦石
0
星屑
7306
在线时间
1244 小时
注册时间
2015-8-15
回帖
473
 楼主| 发表于 2016-2-12 08:20:02 | 显示全部楼层
凝望·流年 发表于 2016-2-12 00:00
推荐再写一个只有文字的window,然后在scene里调用,这样就方便调z值了
想在一个window里调这种图片和文字 ...

跟我的+0是一样的

点评

什么意思……  发表于 2016-2-12 08:21
回复

使用道具 举报

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

本版积分规则

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部