XP 스크립트

Source Thread: http://www.creationasylum.net/forum/index.php?showtopic=568

  말 그대로 돈 액수를 세자리씩 끊어서 표기(123,456,789$)하는 스크립트입니다.


#==============================================================================
# ** Window_Gold
#------------------------------------------------------------------------------
# This window displays amount of gold.
#==============================================================================

class Window_Gold < Window_Base
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
#Advanced Gold Display mini-script by Dubealex.
self.contents.clear
case $game_party.gold
when 0..9999
gold = $game_party.gold
when 10000..99999
gold = $game_party.gold.to_s
array = gold.split(//)
gold = array[0].to_s+array[1].to_s+","+array[2].to_s+array[3].to_s+array[4].to_s
when 100000..999999
gold = $game_party.gold.to_s
array = gold.split(//)
gold = array[0].to_s+array[1].to_s+array[2].to_s+","+array[3].to_s+array[4].to_s+array[5].to_s
when 1000000..9999999
gold = $game_party.gold.to_s
array = gold.split(//)
gold = array[0].to_s+","+array[1].to_s+array[2].to_s+array[3].to_s+","+array[4].to_s+array[5].to_s+array[6].to_s
end

self.contents.font.color = text_color(6)
gold_word = $data_system.words.gold.to_s + ":"
cx = contents.text_size(gold_word).width
cx2=contents.text_size(gold.to_s).width
self.contents.draw_text(4, 0, 120-cx-2, 32, gold_word)
self.contents.font.color = text_color(0)
self.contents.draw_text(124-cx2+2, 0, cx2, 32, gold.to_s, 2)
end
end



** 같은 쓰레드에 올라온 dragonslayer씨의 간략판을 정리한 것입니다:

#==============================================================================
# ** Window_Gold
#------------------------------------------------------------------------------
# This window displays amount of gold.
#==============================================================================

class Window_Gold < Window_Base
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
self.contents.clear
gold = $game_party.gold.to_s
unless gold.size > 4
money = gold
else
case gold.size
when 5
ary = gold.slice!(0,2)
money = ary + ","+ gold
when 6
ary = gold.slice!(0,3)
money = ary + ","+ gold
when 7
ary1 = gold.slice!(0,4)
ary2 = ary1.slice!(1,4)
money = ary1 + ","+ ary2 +","+ gold
end
end
cx = contents.text_size($data_system.words.gold).width
self.contents.font.color = normal_color
self.contents.draw_text(4, 0, 120-cx-2, 32, money, 2)
self.contents.font.color = system_color
self.contents.draw_text(124-cx, 0, cx, 32, $data_system.words.gold, 2)
end
end

 


List of Articles
번호 분류 제목 글쓴이 날짜 조회 수
공지 스크립트 자료 게시물 작성시 주의사항 습작 2012.12.24 6153
1001 전투 ABS_v3액션 알피지 46 file 알피지GM 2010.03.07 5806
1000 퀘스트 퀘스트창 예제 21 지나가던사람 2009.04.05 5742
999 전투 SBABS 버전3.2 - 액알 스크립트 시스템 설명 13 아방스 2007.11.09 5685
998 SBABS 버전3.2 - 액알 스크립트 사용법 34 아방스 2007.11.09 5631
997 이벤트 클릭 시스템 [마우스 스크립트]| 36 아방스 2007.11.09 5622
996 타이틀/게임오버 타이틀 화면 메뉴 변경 24 file 백호 2009.02.22 5586
995 온라인 ORPG 여러분이 원하는 온라인 스크립트 한글화해서 다시 배포! 20 file 심영 2010.10.16 5573
994 HUD [게이지바]2.0버젼「체력,마나,경험치,직업,캐릭터,레벨,돈,맵이름」(HelloCoa2Ver2.0) 67 file 코아 코스튬 2010.10.23 5553
993 액알 스크립트 강좌용~!!!| 27 아방스 2007.11.09 5461
992 타이틀/게임오버 타이틀을 아오오니처럼 만들어보자! 43 file Tassy 2010.06.02 5428
991 온라인 온라인 스크립트 KnM 배포합니다. 43 file 뮤바보 2011.09.23 5350
990 전투 [RTAB]HP/SH/EXP 게이지바 ver 1.00 44 file 환상 러브텔 2010.05.22 5339
989 메뉴 새로운 메뉴 15 file 또라에몽 2010.07.17 5304
988 메뉴 제가추천하는 메뉴스크립트 11 file 백호 2009.02.22 5299
987 미니맵 미니맵을 표시해주는 스크립트입니다... 41 file - 하늘 - 2009.08.05 5191
986 메시지 말풍선 표시 스크립트 48 file insertend 2010.06.06 5161
985 ABM(액알)+Jindow(진도우) 3 WMN 2008.04.06 5116
984 기타 액알 30 지존!! 2010.07.26 5095
983 HUD [맵이동시 맵이름을 표시] 심플한 디자인 36 file 제로스S2 2009.08.05 5001
982 메시지 한글 채팅 스크립트 32 file こなた 2009.01.22 4947
Board Pagination Prev 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 ... 52 Next
/ 52