| 赞 | 14 |
| VIP | |
| 好人卡 | |
| 积分 | 6 |
| 经验 | |
| 最后登录 | 2026-8-9 |
| 在线时间 | 797 小时 |
- 梦石
- 0
- 星屑
- 606
- 在线时间
- 797 小时
- 注册时间
- 2014-7-1
- 回帖
- 501

|
发表于 2016-2-19 16:48:10
|
显示全部楼层
写的应该比较详细了
- class Window_MenuStatus < Window_Selectable
- def initialize
- #这里是界面状态窗口的大小
- super(0, 0, 380, 422)
- self.contents = Bitmap.new(width - 32, height - 32)
- self.contents.font.name = "黑体" #字体
- self.contents.font.size = 16 #文字大小
- #self.x =
- #self.y= 这两个可以根据你的需求来调整窗口的X Y值
- refresh
- self.active = false
- self.index = -1
- end
- #--------------------------------------------------------------------------
- #--------------------------------------------------------------------------
- def refresh
- self.contents.clear
- @item_max = $game_party.actors.size
- for i in 0...$game_party.actors.size
- x = 94
- y =i * 96
- actor = $game_party.actors[i]
- #建立以各bitmap 然后指定素材的位置
- #这里我弄的是一个新文件下Fas
- #然后在这个文件夹下面设定素材的名称对应角色的ID
- #比如阿尔西斯在数据库中的角色ID是1
- #那么图片素材就写1 这样游戏中就对应上了
- #有多少就写多少 没有的话就会提示去缺少素材
- #这样游戏就回报错找不到文件
- #可以试着用容错脚本来防止这一点 脚本来源就搜索
- bitmap=Bitmap.new("Graphics/Fas/#{actor.id}")
- cw = bitmap.width
- ch = bitmap.height
- src_rect = Rect.new(0, 0, cw, ch)
- self.contents.blt(x -100, y - 4, bitmap, src_rect)#脸谱的坐标
- draw_actor_hp(actor, 80, y + 26) #篮和血框间隔的坐标
- draw_actor_sp(actor, 80, y + 53)#篮和血框间隔的坐标
- draw_actor_level(actor, 84,y - 4)#等级的坐标
- draw_actor_state(actor, 100, y + 70)#状态坐标
- draw_actor_name(actor, 80, y+10) #角色名字的坐标
- end
- end
- #--------------------------------------------------------------------------
- # #光标调整
- #--------------------------------------------------------------------------
- def update_cursor_rect
- #这里是光标的位置调整 这个就不多说了
- #自己试一下就知道了
- if @index < 0
- self.cursor_rect.empty
- else
- self.cursor_rect.set(0, @index * 96 - 4, self.width - 70, 100)
- end
- end
- end
复制代码
|
评分
-
查看全部评分
|