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 온라인 멀티넷 스크립트 수정본 (약간 한글화) 7 백호 2009.02.22 2315
400 저장 멀티넷스크립트 -> 아이피 세이브,로드 스크립트 9 file 백호 2009.02.22 2206
399 온라인 멀티넷스크립트 => 채팅보완 스크립트 8 file 백호 2009.02.22 2931
398 온라인 멀티넷플레이 99Q Beta 3 27 백호 2009.02.22 3107
397 이동 및 탈것 멈췄을때 행동. 17 file Bera 2010.10.17 3408
396 기타 멋진...제작자 정보를 그림으로 1 백호 2009.02.22 1233
395 메뉴 메뉴 단축키 스크립트 14 백호 2009.02.22 2961
394 메뉴 메뉴 변경 스크립트 2 file 백호 2009.02.21 2360
393 메뉴 메뉴 화면 개조 스크립트 1 백호 2009.02.21 1668
392 메뉴 메뉴 화면 변경 스크립트 file 백호 2009.02.21 2237
391 메뉴 메뉴....있길래올립니다. 9 벨☆ 2010.01.23 2001
390 메뉴 메뉴등에서 움직이는 엑터 9 file 백호 2009.02.22 3164
389 메뉴 메뉴를 바꾸는 스크립트 14 №1 2012.08.04 4213
388 메뉴 메뉴바꾸기 4 file ureazy 2012.07.23 2847
387 변수/스위치 메뉴변수표시 스크립트 1 file 백호 2009.02.22 1644
386 메뉴 메뉴에 그림넣기 4 file 백호 2009.02.22 4414
385 메뉴 메뉴에 얼굴 그래픽 표시 4 file 백호 2009.02.21 3113
384 메뉴 메뉴에서 실제시간 보기 2 백호 2009.02.21 1124
383 메뉴 메뉴에서 커맨더실행하기 5 WMN 2008.04.06 1682
382 파티 메뉴커맨드로 파티 멤버들 순서 바꾸기 by Yargovish 1 백호 2009.02.22 1622
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