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

Project1

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

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

[复制链接]

Lv4.逐梦者

梦石
0
星屑
7559
在线时间
1315 小时
注册时间
2015-8-15
帖子
747
跳转到指定楼层
1
发表于 2016-2-11 14:44:31 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式

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

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

x
RUBY 代码复制
  1. #==============================================================================
  2. # ■ Window_MenuStatus
  3. #------------------------------------------------------------------------------
  4. #  显示菜单画面和同伴状态的窗口。
  5. #==============================================================================
  6.  
  7.  
  8.  
  9.  
  10. class Window_MenuStatus < Window_Selectable
  11.   #--------------------------------------------------------------------------
  12.   # ● 初始化对像
  13.   #--------------------------------------------------------------------------
  14.     def initialize(actor_index = 0, equip_index = 0)#def initialize(index = 0)
  15.     super(0, 64, 1200, 480)
  16.     @item_max = $game_party.actors.size
  17.     self.contents = Bitmap.new(width - 32, 400)
  18.     refresh
  19.    # self.active = index
  20.     self.index =  index
  21.    # equip_index =
  22.     @column_max = 4
  23.   end
  24.   #--------------------------------------------------------------------------
  25.   # ● 刷新
  26.   #--------------------------------------------------------------------------
  27.     def refresh
  28.  
  29.     self.contents.clear
  30.  
  31.  
  32.    # @item_max = $game_party.actors.size
  33.     for i in 0...$game_party.actors.size
  34. #    draw_item(i, normal_color)
  35.   #  x = ( i + 1 ) * 92 +25
  36.   #  y = 44
  37. #    x = ( i + 1 ) % @column_max * (cursor_width + 1) - 4
  38. #   y = ( i + 1 ) / @column_max * 128 - self.oy
  39.    # x = 0 + index % 4 * (90 + 1) - 4
  40.   #  y = index / 90 * 128 - self.oy
  41.    # actor_width = 128
  42.     x =120 + i % 4 * (58 + 32)  # 根据包裹坐标修改过来的
  43.     y = 44 +  i / 4 * 128
  44.     actor = $game_party.actors[i]
  45.     bitmap = Bitmap.new ("Graphics/Status/" + actor.id. to_s + "_h") #RPG::Cache.character(actor.character_name, actor.character_hue)
  46.     cw = bitmap.width
  47.     ch = bitmap.height
  48.     src_rect = Rect.new(0, 0, cw, ch + 50)
  49.     self.contents.blt(x - ch , y  - cw/ 2, bitmap, src_rect) #src_rect
  50.     draw_actor_xdrs_lx(actor, x-ch, y)#转生次数
  51.  
  52.         if i <= 3
  53.         self.contents.font.color = Color.new(255,255,0,255)
  54.         self.contents.draw_text(x + 200 , y ,160,32,"[出战]",999)
  55.         self.contents.font.color = normal_color
  56.  
  57.       else
  58.         self.contents.font.color = Color.new(128,128,128,255)
  59.         self.contents.draw_text(x ,y,160,32,"[休息]",999)
  60.         self.contents.font.color = normal_color
  61.  
  62.  
  63.   end
  64.   end  
  65.   #   @item_max = $game_party.actors.size
  66.   #  if @item_max > 4
  67.    #   self.contents = Bitmap.new(width - 32, row_max * 32)
  68.    #   for i in 0...@item_max
  69.     #    raw_item(i, normal_color)
  70.     #  end
  71.   #  end
  72. end
  73. #
  74.  
  75.   #--------------------------------------------------------------------------
  76.   # ● 更新光标举行
  77.   #--------------------------------------------------------------------------
  78.  
  79.  
  80.   #--------------------------------------------------------------------------
  81.   # ● 项目无效化
  82.   #     index : 项目编号
  83.   #--------------------------------------------------------------------------
  84.   def disable_item(index)
  85.     draw_item(index, disabled_color)
  86.   end
  87.   #--------------------------------------------------------------------------
  88.   # ● 刷新光标矩形
  89.   #--------------------------------------------------------------------------
  90.  
  91.  
  92.  
  93.  
  94. def update_cursor_rect
  95.     # 光标位置不满 0 的情况下
  96.     if @index <= - 1
  97.       self.cursor_rect.empty
  98.  
  99.       return
  100.     end
  101.     # 获取当前的行
  102.     row = @index / @column_max
  103.     # 当前行被显示开头行前面的情况下
  104.     if row < self.top_row
  105.       # 从当前行向开头行滚动
  106.       self.top_row = row
  107.    end
  108.     # 当前行被显示末尾行之后的情况下
  109.     if row > self.top_row + (self.page_row_max - 1)
  110.       # 从当前行向末尾滚动
  111.       self.top_row = row - (self.page_row_max - 1)
  112.     end
  113.     # 计算光标的宽
  114.     cursor_width = 90
  115.     #cursor_width = 536 / (@column_max + 1) + 1  #光标大小
  116.     # 计算光标坐标
  117.  
  118.     x = 0 + @index % @column_max * (cursor_width + 1) - 4 #光标位置调节 覆盖31行
  119.     y = @index / @column_max * 128 - self.oy
  120.     # 更新国标矩形
  121.     self.cursor_rect.set(x, y, cursor_width, 128)#(x, y, cursor_width, 32)
  122.  
  123.     end
  124.  
  125. end

出战.jpg (84.56 KB, 下载次数: 5)

出战.jpg

Lv2.观梦者

梦石
0
星屑
555
在线时间
111 小时
注册时间
2013-11-22
帖子
301
2
发表于 2016-2-12 00:00:06 | 只看该作者
推荐再写一个只有文字的window,然后在scene里调用,这样就方便调z值了
想在一个window里调这种图片和文字的遮挡关系,目前流年只能用这种方法
否则用精灵什么的很麻烦……
回复 支持 反对

使用道具 举报

Lv4.逐梦者

梦石
0
星屑
7559
在线时间
1315 小时
注册时间
2015-8-15
帖子
747
3
 楼主| 发表于 2016-2-12 08:20:02 | 只看该作者
凝望·流年 发表于 2016-2-12 00:00
推荐再写一个只有文字的window,然后在scene里调用,这样就方便调z值了
想在一个window里调这种图片和文字 ...

跟我的+0是一样的

点评

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

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-9-23 01:29

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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