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

Project1

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

[有事请教] 顯示NPC名稱腳本,請幫忙添加開關功能

[复制链接]

Lv5.捕梦者

梦石
0
星屑
33218
在线时间
10497 小时
注册时间
2009-3-15
帖子
4756
1
发表于 2019-5-17 22:20:09 | 显示全部楼层
RUBY 代码复制
  1. def update
  2.         super
  3.         update_bitmap
  4.         self.visible = (not @character.transparent)
  5.         update_src_rect
  6.         self.x = @character.screen_x
  7.         self.y = @character.screen_y
  8.  
  9.  
  10.         self.z = @character.screen_z
  11.         self.opacity = @character.opacity
  12.         self.blend_type = @character.blend_type
  13.         self.bush_depth = @character.bush_depth
  14.         update_balloon
  15.         if @character.animation_id != 0
  16.           animation = $data_animations[@character.animation_id]
  17.           start_animation(animation)
  18.           @character.animation_id = 0
  19.         end
  20.         if @character.balloon_id != 0
  21.           @balloon_id = @character.balloon_id
  22.           start_balloon
  23.           @character.balloon_id = 0
  24.         end
  25.         ## 名稱可視和跟隨
  26.         unless @name_sprite == nil or @name_sprite.disposed?
  27.           if @character.is_a?(Game_Event) and @character.erased
  28.             @name_sprite.visible = false
  29.             return
  30.           else
  31.             @name_sprite.visible = true
  32.           end
  33.           if @character.is_a?(Game_Player) and @character.in_vehicle?
  34.             @name_sprite.visible = false
  35.             return
  36.           else
  37.             @name_sprite.visible = true
  38.           end
  39.           set_name_sprite
  40.           if @name != @character.name
  41.             @name = @character.name
  42.             refresh_name_sprite
  43.           end
  44.  
  45. #████████████████████████████████████████████████████████████████████████         
  46. #████████████████████████████████████████████████████████████████████████         
  47.           @name_sprite.x = self.x - 250 #原版
  48.           @name_sprite.y = self.y - self.height - NPC::NAME_SIZE+2
  49.  
  50. #~           @name_sprite.x = (self.x  - 250) * 2 - 80  #放大兩倍
  51. #~           @name_sprite.y = (self.y  - self.height - NPC::NAME_SIZE+2) * 2 - 250 #放大兩倍
  52. #████████████████████████████████████████████████████████████████████████         
  53. #████████████████████████████████████████████████████████████████████████
  54. #~           @name_sprite.z = self.z+1
  55.           @name_sprite.z = self.z-60 #優先度++++++
  56.         end
  57.       end

评分

参与人数 1+1 收起 理由
冰冷水藍 + 1 十分感謝!!

查看全部评分

回复

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-5-4 12:29

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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