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 메뉴 제가 쓰는 메뉴 14 file 백호 2009.02.21 2318
900 메뉴 제가 쓰고있는 메뉴 13 file 백호 2009.02.21 3028
899 점프 대쉬 스크립트 11 WMN 2008.03.17 2345
898 이동 및 탈것 점프 높이를 자유자제로 조절하는 스크립트!! 8 file 백호 2009.02.21 1539
897 전투 전투후 경험치 분배와 레벨업시 HP/SP 전회복 15 백호 2009.02.21 2374
896 전투 전투중의 윈도우 전부 투명화 3 file 백호 2009.02.21 1878
895 장비 전투중에 장비변경 from RGSS Wiki 1 백호 2009.02.22 1988
894 전투 전투중에 장비들 교체하기 file 레이스89 2017.08.19 592
893 전투 전투의 커맨드에 따라 능력치를 상승 백호 2009.02.22 904
892 전투 전투의 승리마다 행동에 따라서 능력치가 상승한다! 1 백호 2009.02.22 1238
891 전투 전투위치 보정 스크립트 1 file 백호 2009.02.21 1234
890 전투 전투에서도 맵 BGM 연결하는 스크립트 2 file 백호 2009.02.21 1129
889 전투 전투시 아이콘 윈도우 2 file 백호 2009.02.21 1649
888 전투 전투시 미묘한 효과 스크립트 file 백호 2009.02.21 1466
887 전투 전투불능 케릭터 강제삭제 7 독도2005 2008.10.05 1918
886 전투 전투배경확장 한글 3 백호 2009.02.22 1471
885 전투 전투배경확장 스크립트 3 file 아미상 2013.09.15 2763
884 전투 전투배경 확장 3 file 백호 2009.02.21 1817
883 전투 전투링메뉴.(턴알) 7 백호 2009.02.21 2820
882 전투 전투 특수효과 DamageEX 스크립트 1 file 백호 2009.02.21 1589
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