赞 | 51 |
VIP | 9 |
好人卡 | 4 |
积分 | 30 |
经验 | 7669 |
最后登录 | 2021-3-5 |
在线时间 | 333 小时 |
Lv3.寻梦者
- 梦石
- 0
- 星屑
- 2996
- 在线时间
- 333 小时
- 注册时间
- 2012-2-9
- 帖子
- 313
|
- class Game_Event
- attr_reader :event
- end
- class Sprite_Name < Sprite_Base
-
- FLAG = "~" #姓名前缀,只有拥有该前缀的name才会显示,设为空,则全部都会显示
- #KEY = 10 #全局开关ID,去掉改行以及17行的#即可使用
-
- def initialize(viewport, character = nil)
- super(viewport)
- @cha = character
- end
-
- def update
- super
- return unless @cha.event.name =~ /^#{FLAG}/ #&& $game_switches[KEY]
- if @cha.event.name.split(FLAG)[1] != @name
- @name = @cha.event.name.split(FLAG)[1]
- name_pa = @name.split(/(\\n|\\N)/)
- name_pa.delete('\N')
- name_pa.delete('\n')
- @wid = []
- name_pa.each{|s| @wid << Bitmap.new(100,100).text_size(s).width}
- self.bitmap = Bitmap.new(@wid.max,16 * name_pa.size)
- self.bitmap.font.size = 14
- name_pa.each_with_index{|s,x| self.bitmap.draw_text(0,x * 18,@wid.max,18,s,1)}
- end
- if @cha.character_name == ""
- self.y = @cha.screen_y - 16 * (@wid.size + 2)
- else
- temp_flag = @cha.character_name =~ /^\!?\$.*/
- temp_pic = Cache.character(@cha.character_name)
- self.y = temp_flag ? @cha.screen_y - temp_pic.height / 4 - 18 * @wid.size : @cha.screen_y - temp_pic.height / 8 - 18 * @wid.size
- end
- self.x = @cha.screen_x - @wid.max / 2
- self.z = @cha.screen_z + 100
- end
-
- end
- class Spriteset_Map
-
- alias :iisnow_create_characters :create_characters
-
- def create_characters
- iisnow_create_characters
- $game_map.events.values.each do |event|
- @character_sprites.push(Sprite_Name.new(@viewport1, event))
- end
- end
-
- end
复制代码 伸手自重 |
|