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

Project1

 找回密码
 注册会员
搜索

关于装备图标坐标以及光标问题

查看数: 1525 | 评论数: 3 | 收藏 0
关灯 | 提示:支持键盘翻页<-左 右->
    组图打开中,请稍候......
发布时间: 2016-10-3 07:02

正文摘要:

本帖最后由 【蛋塔】 于 2016-10-3 07:09 编辑 我将Window_Base 312行改成: RUBY 代码复制def draw_icon_name(item, x, y)    if item == nil     &n ...

回复

夜狠简单 发表于 2016-10-3 19:46:31
本帖最后由 夜狠简单 于 2016-10-3 19:49 编辑
【蛋塔】 发表于 2016-10-3 13:57
可能我表达的不好,我想请教的是“光标的XY坐标”怎么改?如上图这种效果,因为装备的位置不是排成一排 ...


RUBY 代码复制
  1. class Window_Selectable1<Window_Selectable
  2.   #--------------------------------------------------------------------------
  3.   # ● 更新光标矩形
  4.   #--------------------------------------------------------------------------
  5.  
  6.   def update_cursor_rect
  7.     super()
  8.     # 计算光标的x,y,宽度
  9.     x,y,cursor_width=[[85,0,90],[85,32,90],[0,32*2,90],[185,32*2,90],
  10.     [85,32*3,125]][@index]
  11.     # 更新光标矩形
  12.     self.cursor_rect.set(x, y, cursor_width, 32)
  13.   end
  14. end
  15. #==============================================================================
  16. # ■ Window_EquipRight
  17. #------------------------------------------------------------------------------
  18. #  装备画面、显示角色现在装备的物品的窗口。
  19. #==============================================================================
  20. class Window_EquipRight< Window_Selectable1
  21.   #--------------------------------------------------------------------------
  22.   # ● 初始化对像
  23.   #     actor : 角色
  24.   #--------------------------------------------------------------------------
  25.   def initialize(actor)
  26.     super(272, 64, 368, 192)
  27.     self.contents = Bitmap.new(width - 32, height - 32)
  28.     @actor = actor
  29.     refresh
  30.     self.index = 0
  31.   end
  32.   #--------------------------------------------------------------------------
  33.   # ● 获取物品
  34.   #--------------------------------------------------------------------------
  35.   def item
  36.     return @data[self.index]
  37.   end
  38.   #--------------------------------------------------------------------------
  39.   # ● 刷新
  40.   #--------------------------------------------------------------------------
  41.   def refresh
  42.     self.contents.clear
  43.     @data = []
  44.     @data.push($data_weapons[@actor.weapon_id])
  45.     @data.push($data_armors[@actor.armor1_id])
  46.     @data.push($data_armors[@actor.armor2_id])
  47.     @data.push($data_armors[@actor.armor3_id])
  48.     @data.push($data_armors[@actor.armor4_id])
  49.     @item_max = @data.size
  50.     self.contents.font.color = system_color
  51.     draw_item_name(@data[0], 92, 32 * 0)
  52.     draw_item_name(@data[1], 92, 32 * 1)
  53.     draw_item_name(@data[2], 4, 32 * 2)
  54.     draw_item_name(@data[3], 192, 32 * 2)
  55.     draw_item_name(@data[4], 92, 32 * 3)
  56.   end
  57.   #--------------------------------------------------------------------------
  58.   # ● 刷新帮助文本
  59.   #--------------------------------------------------------------------------
  60.   def update_help
  61.     @help_window.set_text(self.item == nil ? "" : self.item.description)
  62.   end
  63. end

评分

参与人数 1星屑 +66 梦石 +1 收起 理由
hys111111 + 66 + 1 塞糖

查看全部评分

夜狠简单 发表于 2016-10-3 09:00:07
本帖最后由 夜狠简单 于 2016-10-3 18:04 编辑
这种吗?

点评

对了就是这种,请问这样的坐标是怎么改的?能给个范例学习一下吗?  发表于 2016-10-3 19:33
这跟默认有什么区别么?= =  发表于 2016-10-3 14:15
拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

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

GMT+8, 2025-2-20 17:16

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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