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
234 기타 테트리스 ?구현 스크립트 2 file 백호 2009.02.21 1714
233 기타 턴제새로운거. 39 file 이안 2010.01.17 3296
232 기타 탤레포트 스크립트 3 앞잡이 2011.12.10 2260
231 기타 타이머스크립트 ps인간 2009.01.23 1765
230 기타 클리어 횟수 기록하기 1 file 허걱 2009.08.22 2187
229 기타 캐릭터 소개 화면 22 file 독도2005 2008.10.05 4099
228 기타 카운트 3초 1 file 백호 2009.02.22 1295
227 기타 치트키 시스템 3 백호 2009.02.22 1594
226 기타 창고 시스템 8 백호 2009.02.22 1762
225 기타 창고 스크립트 5 긔염둥이♥ 2012.06.18 1723
224 기타 창고 스크립트 2 백호 2009.02.21 1203
223 기타 참 시스템 완성! 1 file 백호 2009.02.22 1523
222 기타 지정범위안에 들어오면 특정한 움직임을 취한다!! 1 백호 2009.02.21 919
221 기타 좌표 스크립트 2 백호 2009.02.21 908
220 기타 제작한 게임의 파일을 모두 exe파일 하나에 쓸어담기 by sheefo@Creation Asylum 1 file 백호 2009.02.22 1239
219 기타 제련시스템 수정본입니다. 3 file 백호 2009.02.21 1020
218 기타 전투 승리 BGM+페이드아웃 스크립트 1 file 백호 2009.02.21 1159
217 기타 잠수방지 스크립트 12 백호 2009.02.22 1865
216 기타 자동미로 12 file 백호 2009.02.22 2030
215 기타 일시정지 스크립트 2 file 백호 2009.02.22 1796
Board Pagination Prev 1 2 3 4 5 6 7 8 9 10 11 12 13 Next
/ 13