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
901 이름입력 이름입력스크립트 ps인간 2009.01.23 3632
900 아이템 아이템창변경 27 카르닉스 2010.02.26 3631
899 타이틀/게임오버 타이틀 가기전에 오프닝 이벤트 시작하기?! 13 file 백호 2009.02.21 3629
898 기타 3d 렌더링스크립트 어렵게 찾음 9 라구나 2011.03.05 3610
897 전투 RPG Advocate의 데모에서 발췌한 사이드뷰용 전투상태창 4 file 백호 2009.02.22 3596
896 키입력 메세지 입력 스크립트. 25 file Bera 2010.10.18 3582
895 상점 상점 메뉴 개조시킨 스크립트 [한글] 35 file 백호 2009.02.21 3566
894 [ 무기 & 방어구 레벨제한 스크립트 ]엄청유용! ㅎ 24 file 제로스S2 2009.08.05 3554
893 타이틀/게임오버 타이틀 전에 로고 띄우기, 홈피 띄우기, 메일 보내기 13 file 유아 2009.01.09 3554
892 HUD 맵이름스크립트 52 file 이안 2010.01.17 3552
891 HUD xp대화창에 얼굴, 이름 넣기!! [방법두 있음] 3 백호 2009.02.21 3545
890 이동 및 탈것 그림자 스크립트 13 file 백호 2009.02.22 3540
889 전투 [신기술 체험] SRPG-Test 13 file 백호 2009.02.22 3536
888 메뉴 [메뉴] 간단한 형식의 CoaMenu2Scroll 버젼 20 file 코아 코스튬 2010.10.24 3526
887 전투 srpg용 스크립트라는데 4 세죠 2010.03.26 3524
886 전투 사이트뷰 전투 스크립트 (CBS R1) 8 file 백호 2009.02.21 3498
885 이동 및 탈것 새로운 픽셀 이동 스크립트 27 file 케나이 2010.04.10 3496
884 메뉴 링 메뉴 16 Neowitch* 2008.04.18 3478
883 전투 Mr. Mo's ABS 5.5 13 Alkaid 2010.09.10 3459
882 이동 및 탈것 반칸 이동하기 14 file 느싱 2009.03.09 3458
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