RPGXP 스크립트
2013.10.05 06:20

맵이름 표시 스크립트

조회 수 2246 추천 수 0 댓글 18
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄 수정 삭제
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄 수정 삭제

스크립트.PNG

위에 가운데 맵이름이 표시되는 스크립트 입니다

#==============================================================================
# □ 커스터마이즈 포인트
#==============================================================================
module XRXS20
#
# 제외하는 맵ID (맵의 머리의 것 . 을 회피하고 싶은 경우)
#
EXCLUSIVE_MAPS = []
#
# 윈도우범위
#
WINDOW_FRAME = false # 표시
WINDOW_SKIN = "" # 개별 윈도우 스킨("" : 종래)
WINDOW_WIDTH_FIX = 630 # 가로폭 고정(0:고정하지 않고 자동)
WINDOW_HEIGHT = 60 # 세로폭
#
# 폰트
#
FONT_NAME = "나눔고딕"
FONT_COLOR = Color.new(255, 255, 255, 255)
FONT_SIZE = 50
#
# [표시 위치] (0:좌상 ,1:우상 ,2:좌하 ,3:우하)
#
POSITION = 0
#
# [표시 시간]
#
TIME_FADEIN = 40 # 용명
TIME_STOP = 210 # 표시 정지
TIME_FADEOUT = 40 # 페이드아웃
end
#--------------------------------------------------------------------------
# 텍스트 모형
#--------------------------------------------------------------------------
class Window_Map_Name < Window_Base
def text_model(text)
return "" + text + ""
end
end
#
#[기능]
# 맵명의 선두에 피리어드 「.」이 있으면(자) 맵명을 표시하지 않습니다.
#
#==============================================================================
# □ XRXS. 맵 나토리 이득 기구
#==============================================================================
class Game_Map
#--------------------------------------------------------------------------
# ○ 맵명을 취득
#--------------------------------------------------------------------------
def name
$data_mapinfos = load_data("Data/MapInfos.rxdata") if $data_mapinfos.nil?
$data_mapinfos[@map_id].name
end
end

#==============================================================================
# ■ Game_Temp
#==============================================================================
class Game_Temp
#--------------------------------------------------------------------------
# ● 공개 인스턴스 변수
#--------------------------------------------------------------------------
attr_accessor :xrxs20_fade_duration
end
#==============================================================================
# ■ Game_Map
#==============================================================================
class Game_Map
#--------------------------------------------------------------------------
# ● 공개 인스턴스 변수
#--------------------------------------------------------------------------
attr_reader :map_id
end
#==============================================================================
# □ Window_Map_Name_Space
#==============================================================================
class Window_Map_Name_Space < Window_Base
#--------------------------------------------------------------------------
# ○ 오브젝트 초기화
#--------------------------------------------------------------------------
def initialize(x, y, w, h)
super(x-220, y+200, w+132, h+32)
self.opacity = 0
self.visible = false
@align = 1
end
#--------------------------------------------------------------------------
# ○ 문자를 설정
#--------------------------------------------------------------------------
def set_text(text)
# 묘화폭을 계산
if XRXS20::WINDOW_WIDTH_FIX == 0
bitmap = Bitmap.new(1,1)
bitmap.font.name = XRXS20::FONT_NAME
bitmap.font.size = XRXS20::FONT_SIZE
width = bitmap.text_size(text).width + 25
bitmap.dispose
else
width = XRXS20::WINDOW_WIDTH_FIX
end
# 컨텐츠 영역을 작성
if self.contents != nil
self.contents.dispose
end
self.width = width + 32
self.contents = Bitmap.new(width, self.height - 32)
self.contents.font.name = XRXS20::FONT_NAME
self.contents.font.color = XRXS20::FONT_COLOR
self.contents.font.size = XRXS20::FONT_SIZE
self.contents.font.bold = true
if text.nil?
return
end
# 문자의 묘화
x = 12
y = 0
width -= 6
height = self.contents.height
text_color = self.contents.font.color.dup
self.contents.font.color = Color.new( 0, 0, 0, 192)
self.contents.draw_text(x+2, y+2, width, height, text, @align)
self.contents.font.color = Color.new( 64, 64, 64, 192)
self.contents.draw_text(x-1, y-1, width, height, text, @align)
self.contents.draw_text(x+1, y-1, width, height, text, @align)
self.contents.draw_text(x-1, y+1, width, height, text, @align)
self.contents.draw_text(x+1, y+1, width, height, text, @align)
self.contents.font.color = text_color
self.contents.draw_text(x, y, width, height, text, @align)
end
end
#==============================================================================
# □ Window_Map_Name
#------------------------------------------------------------------------------
#  맵명을 표시하는 윈도우입니다.
#==============================================================================
class Window_Map_Name < Window_Base
#--------------------------------------------------------------------------
# ○ 공개 인스턴스 변수
#--------------------------------------------------------------------------
attr_accessor :text
#--------------------------------------------------------------------------
# ○ 오브젝트 초기
#--------------------------------------------------------------------------
def initialize
y = XRXS20::POSITION >= 2 ? 440 : 8
w = 64
h = XRXS20::WINDOW_HEIGHT
super(-w, y, w, h)
self.opacity = 0
self.visible = false
if XRXS20::WINDOW_SKIN != ""
# 스킨의 검색
skin = (RPG::Cache.windowskin(XRXS20::WINDOW_SKIN) rescue nil)
# 스킨의 설정 (스킨이 발견되었을 경우)
self.windowskin = skin unless skin.nil?
end
@space = Window_Map_Name_Space.new(self.x, self.y, self.width, self.height)
end
#--------------------------------------------------------------------------
# ○ 텍스트 설정
# text : 윈도우에 표시하는 캐릭터 라인
#--------------------------------------------------------------------------
def set_text(text)
if text.nil? or text.empty? or text =~ /^./
@showing_time = -1
@text = ""
@space.set_text(@text)
$game_temp.xrxs20_fade_duration = -1
else
# 설정
@text = text_model(text)
# 묘사
@space.set_text(@text)
if XRXS20::WINDOW_WIDTH_FIX == 0
self.width = @space.width - 16
else
self.width = XRXS20::WINDOW_WIDTH_FIX
end
case XRXS20::POSITION % 2
when 0
@x_indent = 4
when 1
@x_indent = 632 - self.width
end
end
self.visible = false
@space.visible = false
# 위치의 갱신
fade_relocation
end
#--------------------------------------------------------------------------
# ○ 페이드 시간에 의한 위치의 갱신
#--------------------------------------------------------------------------
def fade_relocation
# 페이드 시간의 설정
if $game_temp.xrxs20_fade_duration.nil?
$game_temp.xrxs20_fade_duration = (XRXS20::TIME_FADEIN + XRXS20::TIME_STOP + XRXS20::TIME_FADEOUT)
end
#
# 용명
#
d = $game_temp.xrxs20_fade_duration - (XRXS20::TIME_STOP + XRXS20::TIME_FADEOUT)
if d > 0
self.visible = XRXS20::WINDOW_FRAME
@space.visible = true
amount = ((XRXS20::TIME_FADEIN - d) * 255.0 / XRXS20::TIME_FADEIN).ceil
@space.contents_opacity = amount
self.opacity = [amount*5/8, 160].min
self.x = @x_indent - d
@space.x = self.x - 16
$game_temp.xrxs20_fade_duration -= 1
#
# 통상 표시
#
elsif ($game_temp.xrxs20_fade_duration > XRXS20::TIME_FADEOUT) or
($game_temp.xrxs20_fade_duration == 0 and XRXS20::TIME_FADEOUT == 0)
self.visible = XRXS20::WINDOW_FRAME
@space.visible = true
@space.contents_opacity = 255
self.opacity = 160
self.x = @x_indent
@space.x = self.x - 16
if $game_temp.xrxs20_fade_duration > 0
$game_temp.xrxs20_fade_duration -= 1
end
#
# 페이드아웃
#
elsif $game_temp.xrxs20_fade_duration > 0
self.visible = XRXS20::WINDOW_FRAME
@space.visible = true
amount = ($game_temp.xrxs20_fade_duration * 255.0 / XRXS20::TIME_FADEOUT).ceil
@space.contents_opacity = amount
self.opacity = amount * 5/8
self.x = (@x_indent + XRXS20::TIME_FADEOUT) - $game_temp.xrxs20_fade_duration
@space.x = self.x - 16
$game_temp.xrxs20_fade_duration -= 1
if $game_temp.xrxs20_fade_duration == 0
self.visible = false
@space.visible = false
end
end
end
#--------------------------------------------------------------------------
# ○ 프레임 갱신 [오버라이드(override)]
#--------------------------------------------------------------------------
def update
fade_relocation
super
end
#--------------------------------------------------------------------------
# ○ 해방 [오버라이드(override)]
#--------------------------------------------------------------------------
def dispose
@space.dispose
super
end
#--------------------------------------------------------------------------
# ○ 가시 상태 [오버라이드(override)]
#--------------------------------------------------------------------------
def visible=(b)
@space.visible = b unless @space.nil?
super
end
end
#==============================================================================
# ■ Scene_Map
#==============================================================================
class Scene_Map
#--------------------------------------------------------------------------
# ● 메인 처리
#--------------------------------------------------------------------------
alias xrxs20_main main
def main
# 지명 윈도우를 작성
@map_name_window = Window_Map_Name.new
# 지명 윈도우의 갱신
name = XRXS20::EXCLUSIVE_MAPS.include?($game_map.map_id) ? nil : $game_map.name
@map_name_window.set_text(name)
# 되돌리는
xrxs20_main
# 지명 윈도우를 해방
@map_name_window.dispose
end
#--------------------------------------------------------------------------
# ● 프레임 갱신
#--------------------------------------------------------------------------
alias xrxs20_update update
def update
# 지명 윈도우의 갱신
@map_name_window.update
# 귀환시키는
xrxs20_update
end
#--------------------------------------------------------------------------
# ● 플레이어의 장소 이동
#--------------------------------------------------------------------------
alias xrxs20_transfer_player transfer_player
def transfer_player
# 지명 윈도우의 불가시화
@map_name_window.visible = false
# 귀환시키는
xrxs20_transfer_player
# 페이드 시간의 클리어
$game_temp.xrxs20_fade_duration = nil
# 지명 윈도우의 갱신
name = XRXS20::EXCLUSIVE_MAPS.include?($game_map.map_id) ? nil : $game_map.name
@map_name_window.set_text(name)
end
end

 

 

?
  • ?
    ↑고수의길↑ 2013.10.05 18:33
    감사합니다.
  • ?
     운 2013.10.05 19:36
    네 ㅎ
  • ?
    두부 2013.10.05 20:12
    감사히 사용하겠습니다!
  • ?
     운 2013.10.05 20:13
    네 ㅎ 유용되길바라네요.
  • ?
    컨트롤 2013.10.05 23:52
    오오오 좋네요 !
  • ?
     운 2013.10.06 00:04

    폰트 다른걸로 바뀌도 됩니다.
  • ?
    컨트롤 2013.10.06 00:03
    저기
    나눔고딕 글꼴을
    다른걸로 바꿔도 적용이 되나요 ?
    @@
    모바일 에도 적용 되나요?
  • ?
     운 2013.10.05 23:53
    ㅎㅎ
  • ?
    오니파이트 2013.10.08 05:10
    보기에는 어렵지만 도움이 되었기에 감사합니다
    (동생 게임제작에 도움이 되었음)
  • ?
    카티스 2013.10.14 03:59
    왜 저는 않나오죠? ㅠㅠ
  • ?
    지직 2014.08.13 05:08
    저도 안나옴 ㅠㅠ
  • ?
    촙짜 2013.11.15 01:30
    감사합니다!
  • ?
    500wonsoft 2013.12.15 02:33
    정말로 감사합니다!
  • profile
    주섬주섬 2013.12.29 19:50
    오호... 네코데브 사이트에 있는 스크립트 만 넣어도 대작이 되겠군요.
  • ?
    국내산해초 2014.02.26 09:49
    오류떠요ㅠㅠ 윈도우베이스어쩌고라고영어로뜨는데...
    Erro no scrips mapname, em 36 na linha 'TypeError'
    undefined superclass 'Window_Base'
  • ?
    국내산해초 2014.03.13 07:39
    어떻게해야맵이름이나오죠...?
    초보라서.....
  • ?
     운 2014.02.27 02:16
    툴 스크립트에디터 가셔서, 맨위에 "추가" 해주시고, 맨밑에 가셔서 Main 위에 스크립트를 넣어주시면됩니다.
    참고로 스크립트를 많이넣거나하시면, 충돌일수도 있습니다.
    스크립트가 몇개는넣었다면, 순서를 바꾸다보시면, 잘돌아갈수있을수 있습니다.
  • ?
    대극장 2015.02.08 21:21
    정말 감사합니다! 잘쓸게요.

  1. 맵이름 표시 스크립트

    Date2013.10.05 CategoryRPGXP 스크립트 By 운 Views2246 Votes0
    Read More
  2. 맵 이름을 화면 상단에 띄우기.

    Date2008.10.12 CategoryRPGXP 스크립트 By창조도시 Views2083 Votes1
    Read More
  3. 맵 이름을 화면 상단에 띄우기.

    Date2008.10.12 CategoryRPGXP 스크립트 By창조도시 Views2746 Votes1
    Read More
  4. 맵 이름 표시 스크립트

    Date2013.09.20 CategoryRPGXP 스크립트 By청담 Views1441 Votes0
    Read More
  5. 맵 이동시 로딩 그림 표시 스크립트

    Date2013.09.24 CategoryRPGXP 스크립트 By청담 Views718 Votes0
    Read More
  6. 말풍선 메세지 스크립트

    Date2014.02.24 CategoryRPGXP 스크립트 By천둥번들 Views1855 Votes0
    Read More
  7. 로고를 띄우는 스크립트

    Date2013.10.07 CategoryRPGXP 스크립트 ByXEONSOFT블로그 Views1681 Votes0
    Read More
  8. 로고 스크립트

    Date2014.12.10 CategoryRPGXP 스크립트 By 운 Views1179 Votes1
    Read More
  9. 레벨업시 전회복 스크립트

    Date2013.09.24 CategoryRPGXP 스크립트 By청담 Views694 Votes0
    Read More
  10. 레벨업시 능력치 표시

    Date2013.10.01 CategoryRPGXP 스크립트 By Views1081 Votes0
    Read More
  11. 동료가 기차처럼 따라오는 스크립트

    Date2013.09.24 CategoryRPGXP 스크립트 By청담 Views1119 Votes0
    Read More
  12. 대화창에 이름&얼굴 띄우기 새로운방식.

    Date2007.11.06 CategoryRPGXP 스크립트 By창조도시 Views3482 Votes3
    Read More
  13. 대화창에 이름&얼굴 띄우기 새로운방식.

    Date2007.11.06 CategoryRPGXP 스크립트 By창조도시 Views3594 Votes3
    Read More
  14. 대화창에 얼굴 띄우기& 대화창 명령어 모음.

    Date2008.12.31 CategoryRPGXP 스크립트 By창조도시 Views2083 Votes1
    Read More
  15. 대화창에 얼굴 띄우기& 대화창 명령어 모음.

    Date2008.12.31 CategoryRPGXP 스크립트 By창조도시 Views2823 Votes1
    Read More
  16. 대화에 얼굴이 나오는 스크립트 by: killarot(네이버 dust_mite)(수정버전)

    Date2016.02.22 CategoryRPGXP 스크립트 By부초 Views1899 Votes0
    Read More
  17. 대화 글씨가 한글자씩 나오는 스크립트

    Date2013.09.24 CategoryRPGXP 스크립트 By청담 Views1417 Votes0
    Read More
  18. 대화 글씨 폰트를 원하는 폰트로 바꾸기

    Date2007.12.01 CategoryRPGXP 스크립트 By창조도시 Views1392 Votes2
    Read More
  19. 대화 글씨 폰트를 원하는 폰트로 바꾸기

    Date2007.12.01 CategoryRPGXP 스크립트 By창조도시 Views1813 Votes2
    Read More
  20. 대기 회복 스크립트

    Date2013.10.01 CategoryRPGXP 스크립트 By Views1078 Votes0
    Read More
Board Pagination Prev 1 2 3 4 5 6 7 8 Next
/ 8






[개인정보취급방침] | [이용약관] | [제휴문의] | [후원창구] | [인디사이드연혁]

Copyright © 1999 - 2016 INdiSide.com/(주)씨엘쓰리디 All Rights Reserved.
인디사이드 운영자 : 천무(이지선) | kernys(김원배) | 사신지(김병국)