XP 스크립트

제작자 : 준돌

#=================================================
# ■ 직업명 띄우기
#-------------------------------------------------
#  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이름]
이렇게 하시면 됩니다.

비밀소년님의 아이디 스크립트와 혼용해야 좋습니다^^

Who's 백호

?

이상혁입니다.

http://elab.kr


List of Articles
번호 분류 제목 글쓴이 날짜 조회 수
공지 스크립트 자료 게시물 작성시 주의사항 습작 2012.12.24 6153
721 이동 및 탈것 Mouse_move file 백호 2009.02.21 922
720 기타 [KGC]강화스크립트 백호 2009.02.21 1667
719 이동 및 탈것 마우스 이동 조금 뜯어봤습니다. file 백호 2009.02.21 1680
718 전투 시뮬레이션 턴알 3 file 백호 2009.02.21 3054
717 이동 및 탈것 Mouse_move 호환버전 1 file 백호 2009.02.21 1059
716 기타 레벨9999스크립트 4 백호 2009.02.21 1151
715 이동 및 탈것 Mouse_move 호환 100%강화버전 4 file 백호 2009.02.21 1512
714 메시지 문자 메세지 띄우기 스크립트 10 file 백호 2009.02.21 3069
713 이동 및 탈것 젤다 스타일 맵스크롤 5 file 백호 2009.02.21 1839
712 메뉴 Tales Of Symphonia Menu 8 file 백호 2009.02.21 1744
711 장비 [KGC]장비 제한(레벨,완력등등) 7 file 백호 2009.02.21 1780
710 기타 [KGC]HP&SP게이지 색다른것(글씨와 게이지가 안겹침) 10 file 백호 2009.02.21 2732
709 아이템 아이템 정리기능 S크립T 1 file 백호 2009.02.21 1081
708 기타 무기& 방어구 레벨제한 스크립트 23 file 백호 2009.02.21 1880
» HUD 직업명띄우기 스크립트 2 백호 2009.02.21 1123
706 전투 A-battle 수정 file 백호 2009.02.21 1155
705 기타 말걸면그림천천히뜨기 4 file 백호 2009.02.21 1101
704 전투 횡스크롤형식의 스크립트 7 백호 2009.02.21 2972
703 HUD 새로운방법의 맵이름 표시 31 file 백호 2009.02.21 4617
702 메뉴 제가 쓰는 메뉴 14 file 백호 2009.02.21 2318
Board Pagination Prev 1 ... 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 ... 52 Next
/ 52