제작자 : 준돌
#=================================================
# ■ 직업명 띄우기
#-------------------------------------------------
# Author: 준돌
# Desc: 머리위에 직업을 띄웁니다
#
# 비밀소년님의 아이디 스크립트랑 사용하면 좋음
#=================================================
class Game_Player
alias class_refresh refresh
def refresh
class_refresh
if $game_party.actors.size > 0
@sprite_class = $game_party.actors[0].class_name
end
end
end
class Game_Event < Game_Event
alias class_refresh refresh
def refresh
class_refresh
text = @event.name.dup
text.gsub!(/[[Cc][Ll](.+?)]/) do
@sprite_class = $1
end
@sprite_class = nil if @erased
@sprite_class = nil if @character_name == ""
end
end
class Game_Character
attr_accessor :sprite_class
end
class Sprite_Character
def create_class_sprite(text)
bitmap = Bitmap.new(160, 16)
bitmap.font.name = "바탕체"
bitmap.font.size = 12
bitmap.font.color.set(0, 0, 0)
bitmap.draw_text(+1, +1, 160, 16, text, 1)
bitmap.font.color.set(255, 10, 10)
bitmap.draw_text(0, 0, 160, 16, text, 1)
@_class_sprite = Sprite.new(self.viewport)
@_class_sprite.bitmap = bitmap
@_class_sprite.ox = 80
@_class_sprite.oy = 14
@_class_sprite.x = self.x
@_class_sprite.y = self.y - self.oy / 2 - 14
@_class_sprite.z = 3000
@_class_sprite_visible = true
end
def dispose_class_sprite
@_class_sprite.dispose
@_class_sprite_visible = false
end
def update_class_sprite
if @character.sprite_class != nil
if not @_class_sprite_visible
create_class_sprite(@character.sprite_class)
end
@_class_sprite.x = self.x
@_class_sprite.y = self.y - self.oy - 14
else
if @_class_sprite_visible
dispose_class_sprite
end
end
end
alias class_update update
def update
class_update
update_class_sprite
end
end
#-------------------------------------------------------여기까지
직업명을 띄웁니다.
이벤트도 가능한데요
이벤트명에다가
[CL이름]
이렇게 하시면 됩니다.
비밀소년님의 아이디 스크립트와 혼용해야 좋습니다^^
#=================================================
# ■ 직업명 띄우기
#-------------------------------------------------
# Author: 준돌
# Desc: 머리위에 직업을 띄웁니다
#
# 비밀소년님의 아이디 스크립트랑 사용하면 좋음
#=================================================
class Game_Player
alias class_refresh refresh
def refresh
class_refresh
if $game_party.actors.size > 0
@sprite_class = $game_party.actors[0].class_name
end
end
end
class Game_Event < Game_Event
alias class_refresh refresh
def refresh
class_refresh
text = @event.name.dup
text.gsub!(/[[Cc][Ll](.+?)]/) do
@sprite_class = $1
end
@sprite_class = nil if @erased
@sprite_class = nil if @character_name == ""
end
end
class Game_Character
attr_accessor :sprite_class
end
class Sprite_Character
def create_class_sprite(text)
bitmap = Bitmap.new(160, 16)
bitmap.font.name = "바탕체"
bitmap.font.size = 12
bitmap.font.color.set(0, 0, 0)
bitmap.draw_text(+1, +1, 160, 16, text, 1)
bitmap.font.color.set(255, 10, 10)
bitmap.draw_text(0, 0, 160, 16, text, 1)
@_class_sprite = Sprite.new(self.viewport)
@_class_sprite.bitmap = bitmap
@_class_sprite.ox = 80
@_class_sprite.oy = 14
@_class_sprite.x = self.x
@_class_sprite.y = self.y - self.oy / 2 - 14
@_class_sprite.z = 3000
@_class_sprite_visible = true
end
def dispose_class_sprite
@_class_sprite.dispose
@_class_sprite_visible = false
end
def update_class_sprite
if @character.sprite_class != nil
if not @_class_sprite_visible
create_class_sprite(@character.sprite_class)
end
@_class_sprite.x = self.x
@_class_sprite.y = self.y - self.oy - 14
else
if @_class_sprite_visible
dispose_class_sprite
end
end
end
alias class_update update
def update
class_update
update_class_sprite
end
end
#-------------------------------------------------------여기까지
직업명을 띄웁니다.
이벤트도 가능한데요
이벤트명에다가
[CL이름]
이렇게 하시면 됩니다.
비밀소년님의 아이디 스크립트와 혼용해야 좋습니다^^