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 7316
641 스크립트 호출 명령어 통합버전 / Version 2.21 / 8 WMN 2008.04.06 1564
640 기타 Trailing Characters ver.1 by SephirothSpawn 6 file 백호 2009.02.22 1564
639 전투 버틀러 색조 변경 5 file 백호 2009.02.21 1568
638 이동 및 탈것 점프 높이를 자유자제로 조절하는 스크립트!! 8 file 백호 2009.02.21 1568
637 메뉴 Ring menu edit (Non-SDK ver.) Alkaid 2010.09.08 1570
636 기타 데미지 출력 스크립트 예제 9 file 백호 2009.02.22 1572
635 장비 Multislots! 2.1 by DerVVulfman 3 file Alkaid 2010.09.02 1576
634 메시지 UCoder's Message System by Mr.Mo file Alkaid 2010.10.05 1580
» 기타 Advanced Gold Display by Dubealex (돈 액수를 세자리씩 끊어 표기) 2 Alkaid 2010.11.18 1580
632 저장 Chaos Project Save Layout 1.4 by Fantasist, Blizzard file Alkaid 2010.10.08 1582
631 이동 및 탈것 Maplinks - 맵연결을 쉽게 하기 1 백호 2009.02.22 1587
630 저장 Advanced Save System Edit (현재 맵을 보여주지 않음) file 백호 2009.02.22 1589
629 메뉴 1-Scene CMS 1.16 by LegACy (SDK호환) 3 file 백호 2009.02.22 1589
628 전투 방어시회복하는거래요. 8 카르닉스 2010.02.26 1590
627 이동 및 탈것 텔레포트 마나소비량 수정하기 3 지존!! 2010.07.22 1594
626 기타 이벤트 범위 스크립트 2 Tine 2012.07.25 1595
625 그래픽 Composite Window Skins by PK8 (XP/VX/VXA) Alkaid 2012.08.26 1596
624 이동 및 탈것 이벤트의 점프의 길이를 자유자제로~! 아랫꺼 업글버전 3 file 백호 2009.02.21 1597
623 메뉴 Star Ocean 3 형식으로 스테이터스 화면 변경 1 file 백호 2009.02.21 1598
622 메뉴 스테이터스 화면 from Harts Horn 2 백호 2009.02.22 1598
Board Pagination Prev 1 ... 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 ... 52 Next
/ 52