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 6198
401 전투 S.G DamageShield Script 백호 2009.02.22 935
400 이동 및 탈것 밑에 KIN 님의 MP 없어지는 대쉬, 제가 손좀 봤음 1 백호 2009.02.22 1247
399 메뉴 비밀소년님의 필드에서 경치 % 로 나오는거 윈도우 없이 8 백호 2009.02.22 1792
398 기타 비밀소년님의 경험치 표시 스크립트 백호 2009.02.22 1419
397 기타 Character Creator by Leon@Creation Asylum 2 file 백호 2009.02.22 1511
396 스킬 Advanced Mission Skills/Shop/Manager by trickster 3 file 백호 2009.02.22 1604
395 이름입력 한글이름 입력기 스크립트 14 백호 2009.02.22 4211
394 기타 레벨업포인트 3 백호 2009.02.22 1693
393 타이틀/게임오버 타이틀음악 백호 2009.02.22 1410
392 기타 Sized Events 0.1 by Toby@rmxp.org file 백호 2009.02.22 847
391 기타 Shift Puzzles v2 by SephirothSpawn (SDK호환) 3 file 백호 2009.02.22 1170
390 기타 레벨을 표시해주는 스크립트 5 백호 2009.02.22 2404
389 기타 경험치 퍼센트 수정 백호 2009.02.22 1211
388 기타 필드에서 체력을 출력합니다. 4 백호 2009.02.22 1740
387 기타 필드에서 마력을 출력합니다. 백호 2009.02.22 988
386 맵/타일 Mode07 0.5 by mewsterus 3 백호 2009.02.22 1155
385 기타 Realistic Shop by MeisMe@rmxp.org 3 file 백호 2009.02.22 1293
384 기타 양손무기, 전신갑옷 스크립트 2 백호 2009.02.22 1715
383 기타 무기 회피율, 방어구 공격력 지정 스크립트 6 백호 2009.02.22 1248
382 기타 KGC - 입수 경험치&금 증가 스크립트 백호 2009.02.22 1307
Board Pagination Prev 1 ... 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 ... 52 Next
/ 52