XP 스크립트

#==============================================================================
# ■ Window_RingMenu
#==============================================================================
class Window_RingMenu < Window_Base
#--------------------------------------------------------------------------
# ○ クラス定?
# 링메뉴 소지금,플레이시간 추가 버젼 : tmdgks7243
#--------------------------------------------------------------------------
STARTUP_FRAMES = 20 # 初期アニメ?ションのフレ?ム?
MOVING_FRAMES = 5 # リングを回した時のフレ?ム?
RING_R = 64 # リングの半?
ICON_ITEM = RPG::Cache.icon("034-Item03") # 「アイテム」メニュ?のアイコン
ICON_SKILL = RPG::Cache.icon("044-Skill01") # 「スキル」メニュ?のアイコン
ICON_EQUIP = RPG::Cache.icon("001-Weapon01") # 「?備」メニュ?のアイコン
ICON_STATUS = RPG::Cache.icon("050-Skill07") # 「ステ?タス」メニュ?のアイコン
ICON_SAVE = RPG::Cache.icon("038-Item07") # 「セ?ブ」メニュ?のアイコン
ICON_EXIT = RPG::Cache.icon("046-Skill03") # 「終了」メニュ?のアイコン
ICON_DISABLE= RPG::Cache.icon("") # 使用禁止項目に付くアイコン
SE_STARTUP = "056-Right02" # メニュ?を開いたときに鳴らすSE
MODE_START = 1 # スタ?トアップアニメ?ション
MODE_WAIT = 2 # 待機
MODE_MOVER = 3 # 時計回り回?アニメ?ション
MODE_MOVEL = 4 # 反時計回り回?アニメ?ション
#--------------------------------------------------------------------------
# ○ アクセサ
#--------------------------------------------------------------------------
attr_accessor :index
#--------------------------------------------------------------------------
# ● オブジェクト初期化
#--------------------------------------------------------------------------
def initialize( center_x, center_y )
super(0, 0, 640, 480)
self.contents = Bitmap.new(width-32, height-32)
self.opacity = 0
self.back_opacity = 0
s1 = $data_system.words.item
s2 = $data_system.words.skill
s3 = $data_system.words.equip
s4 = "캐릭터정보"
s5 = "세이브"
s6 = "게임종료"
@commands = [ s1, s2, s3, s4, s5, s6 ]
@item_max = 6
@index = 0
@items = [ ICON_ITEM, ICON_SKILL, ICON_EQUIP, ICON_STATUS, ICON_SAVE, ICON_EXIT ]
@disabled = [ false, false, false, false, false, false ]
@cx = center_x - 16
@cy = center_y - 16
setup_move_start
refresh
end
#--------------------------------------------------------------------------
# ● フレ?ム更新
#--------------------------------------------------------------------------
def update
super
refresh
end
#--------------------------------------------------------------------------
# ● ?面再描?
#--------------------------------------------------------------------------
def refresh
self.contents.clear
# アイコンを描?
case @mode
when MODE_START
refresh_start
when MODE_WAIT
refresh_wait
when MODE_MOVER
refresh_move(1)
when MODE_MOVEL
refresh_move(0)
end
# アクティブなコマンド名表示
rect = Rect.new(@cx - 272, @cy + 24, self.contents.width-32, 32)
self.contents.draw_text(rect, @commands[@index],1)

 

end
#--------------------------------------------------------------------------
# ○ ?面再描?(初期化時)
#--------------------------------------------------------------------------
def refresh_start
d1 = 2.0 * Math::PI / @item_max
d2 = 1.0 * Math::PI / STARTUP_FRAMES
r = RING_R - 1.0 * RING_R * @steps / STARTUP_FRAMES
for i in 0...@item_max
j = i - @index
d = d1 * j + d2 * @steps
x = @cx + ( r * Math.sin( d ) ).to_i
y = @cy - ( r * Math.cos( d ) ).to_i
draw_item(x, y, i)
end
@steps -= 1
if @steps < 1
@mode = MODE_WAIT
end
end
#--------------------------------------------------------------------------
# ○ ?面再描?(待機時)
#--------------------------------------------------------------------------
def refresh_wait
d = 2.0 * Math::PI / @item_max
for i in 0...@item_max
j = i - @index
x = @cx + ( RING_R * Math.sin( d * j ) ).to_i
y = @cy - ( RING_R * Math.cos( d * j ) ).to_i
draw_item(x, y, i)
end
end
#--------------------------------------------------------------------------
# ○ ?面再描?(回?時)
# mode : 0=反時計回り 1=時計回り
#--------------------------------------------------------------------------
def refresh_move( mode )
d1 = 2.0 * Math::PI / @item_max
d2 = d1 / MOVING_FRAMES
d2 *= -1 if mode != 0
for i in 0...@item_max
j = i - @index
d = d1 * j + d2 * @steps
x = @cx + ( RING_R * Math.sin( d ) ).to_i
y = @cy - ( RING_R * Math.cos( d ) ).to_i
draw_item(x, y, i)
end
@steps -= 1
if @steps < 1
@mode = MODE_WAIT
end
end
#--------------------------------------------------------------------------
# ● 項目の描?
# x :
# y :
# i : 項目番?
#--------------------------------------------------------------------------
def draw_item(x, y, i)
#p "x=" + x.to_s + " y=" + y.to_s + " i=" + @items[i].to_s
rect = Rect.new(0, 0, @items[i].width, @items[i].height)
if @index == i
self.contents.blt( x, y, @items[i], rect )
if @disabled[@index]
self.contents.blt( x, y, ICON_DISABLE, rect )
end
else
self.contents.blt( x, y, @items[i], rect, 128 )
if @disabled[@index]
self.contents.blt( x, y, ICON_DISABLE, rect, 128 )
end
end
end
#--------------------------------------------------------------------------
# ● 項目を無?にする
# index : 項目番?
#--------------------------------------------------------------------------
def disable_item(index)
@disabled[index] = true
end
#--------------------------------------------------------------------------
# ○ 初期化アニメ?ションの準備
#--------------------------------------------------------------------------
def setup_move_start
@mode = MODE_START
@steps = STARTUP_FRAMES
if SE_STARTUP != nil and SE_STARTUP != ""
Audio.se_play("Audio/SE/" + SE_STARTUP, 80, 100)
end
end
#--------------------------------------------------------------------------
# ○ 回?アニメ?ションの準備
#--------------------------------------------------------------------------
def setup_move_move(mode)
if mode == MODE_MOVER
@index -= 1
@index = @items.size - 1 if @index < 0
elsif mode == MODE_MOVEL
@index += 1
@index = 0 if @index >= @items.size
else
return
end
@mode = mode
@steps = MOVING_FRAMES
end
#--------------------------------------------------------------------------
# ○ アニメ?ション中かどうか
#--------------------------------------------------------------------------
def animation?
return @mode != MODE_WAIT
end
end
#==============================================================================
# ■ Window_MenuStatus
#------------------------------------------------------------------------------
#  メニュ??面でパ?ティメンバ?のステ?タスを表示するウィンドウです。
#==============================================================================

class Window_RingMenuStatus < Window_Selectable
#--------------------------------------------------------------------------
# ● オブジェクト初期化
#--------------------------------------------------------------------------
def initialize
super(204, 64, 232, 352)
self.contents = Bitmap.new(width - 32, height - 32)
refresh
self.active = false
self.index = -1
end
#--------------------------------------------------------------------------
# ● リフレッシュ
#--------------------------------------------------------------------------
def refresh
self.contents.clear
@item_max = $game_party.actors.size
for i in 0...$game_party.actors.size
x = 80
y = 80 * i
actor = $game_party.actors[i]
draw_actor_graphic(actor, x - 40, y + 80)
draw_actor_name(actor, x, y + 24)
end
end
#--------------------------------------------------------------------------
# ● カ?ソルの矩形更新
#--------------------------------------------------------------------------
def update_cursor_rect
if @index < 0
self.cursor_rect.empty
else
self.cursor_rect.set(0, @index * 80, self.width - 32, 80)
end
end
end
#==============================================================================
# #■ Scene_RingMenu
# ■ Scene_Menu
#------------------------------------------------------------------------------
#  メニュ??面の?理を行うクラスです。
#==============================================================================

#class Scene_RingMenu
class Scene_Menu
#--------------------------------------------------------------------------
# ● オブジェクト初期化
# menu_index : コマンドのカ?ソル初期位置
#--------------------------------------------------------------------------
def initialize(menu_index = 0)
@menu_index = menu_index
end
#--------------------------------------------------------------------------
# ● メイン?理
#--------------------------------------------------------------------------
def main
      @gold_window = Window_Gold.new
    @gold_window.x = 0
    @gold_window.y = 318
    @gold_window.visible = true
    @time_window = Window_PlayTime.new
    @time_window.x = 0 #화면상에 뜨는창의 x좌표
    @time_window.y = 204 #화면상에 뜨는창의 y좌표
    @time_window.visible = true
# スプライトセットを作成
@spriteset = Spriteset_Map.new
# コマンドウィンドウを作成
px = $game_player.screen_x - 15
py = $game_player.screen_y - 24
@command_window = Window_RingMenu.new(px,py)
@command_window.index = @menu_index
# パ?ティ人?が 0 人の場合
if $game_party.actors.size == 0
# アイテム、スキル、?備、ステ?タスを無?化
@command_window.disable_item(0)
@command_window.disable_item(1)
@command_window.disable_item(2)
@command_window.disable_item(3)
end
@command_window.z = 100
# セ?ブ禁止の場合
if $game_system.save_disabled
# セ?ブを無?にする
@command_window.disable_item(4)
end
# ステ?タスウィンドウを作成
@status_window = Window_RingMenuStatus.new
@status_window.x = 160
@status_window.y = 0
@status_window.z = 200
@status_window.visible = false
# トランジション?行
Graphics.transition
# メインル?プ
loop do
# ゲ?ム?面を更新
Graphics.update
# 入力情報を更新
Input.update
# フレ?ム更新
update
# ?面が切り替わったらル?プを中?
if $scene != self
break
end
end
# トランジション準備
Graphics.freeze
# スプライトセットを解放
@spriteset.dispose
# ウィンドウを解放
@command_window.dispose
@status_window.dispose
@gold_window.dispose
@time_window.visible = false
    end
#--------------------------------------------------------------------------
# ● フレ?ム更新
#--------------------------------------------------------------------------
def update
# ウィンドウを更新
@command_window.update
@status_window.update
# コマンドウィンドウがアクティブの場合: update_command を呼ぶ
if @command_window.active
update_command
return
end
# ステ?タスウィンドウがアクティブの場合: update_status を呼ぶ
if @status_window.active
update_status
return
end
end
#--------------------------------------------------------------------------
# ● フレ?ム更新 (コマンドウィンドウがアクティブの場合)
#--------------------------------------------------------------------------
def update_command
# B ボタンが押された場合
if Input.trigger?(Input::B)
# キャンセル SE を演奏
$game_system.se_play($data_system.cancel_se)
# マップ?面に切り替え
$scene = Scene_Map.new
return
end
# C ボタンが押された場合
if Input.trigger?(Input::C)
# パ?ティ人?が 0 人で、セ?ブ、ゲ?ム終了以外のコマンドの場合
if $game_party.actors.size == 0 and @command_window.index < 4
# ブザ? SE を演奏
$game_system.se_play($data_system.buzzer_se)
return
end
# コマンドウィンドウのカ?ソル位置で分岐
case @command_window.index
when 0 # アイテム
# 決定 SE を演奏
$game_system.se_play($data_system.decision_se)
# アイテム?面に切り替え
$scene = Scene_Item.new
when 1 # スキル
# 決定 SE を演奏
$game_system.se_play($data_system.decision_se)
# ステ?タスウィンドウをアクティブにする
@command_window.active = false
@status_window.active = true
@status_window.visible = true
@status_window.index = 0
when 2 # ?備
# 決定 SE を演奏
$game_system.se_play($data_system.decision_se)
# ステ?タスウィンドウをアクティブにする
@command_window.active = false
@status_window.active = true
@status_window.visible = true
@status_window.index = 0
when 3 # ステ?タス
# 決定 SE を演奏
$game_system.se_play($data_system.decision_se)
# ステ?タスウィンドウをアクティブにする
@command_window.active = false
@status_window.active = true
@status_window.visible = true
@status_window.index = 0
when 4 # セ?ブ
# セ?ブ禁止の場合
if $game_system.save_disabled
# ブザ? SE を演奏
$game_system.se_play($data_system.buzzer_se)
return
end
# 決定 SE を演奏
$game_system.se_play($data_system.decision_se)
# セ?ブ?面に切り替え
$scene = Scene_Save.new
when 5 # ゲ?ム終了
# 決定 SE を演奏
$game_system.se_play($data_system.decision_se)
# ゲ?ム終了?面に切り替え
$scene = Scene_End.new
end
return
end
# アニメ?ション中ならカ?ソルの?理を行わない
return if @command_window.animation?
# ↑or← ボタンが押された場合
if Input.press?(Input::UP) or Input.press?(Input::LEFT)
$game_system.se_play($data_system.cursor_se)
@command_window.setup_move_move(Window_RingMenu::MODE_MOVEL)
return
end
# ↓or→ ボタンが押された場合
if Input.press?(Input::DOWN) or Input.press?(Input::RIGHT)
$game_system.se_play($data_system.cursor_se)
@command_window.setup_move_move(Window_RingMenu::MODE_MOVER)
return
end
end
#--------------------------------------------------------------------------
# ● フレ?ム更新 (ステ?タスウィンドウがアクティブの場合)
#--------------------------------------------------------------------------
def update_status
# B ボタンが押された場合
if Input.trigger?(Input::B)
# キャンセル SE を演奏
$game_system.se_play($data_system.cancel_se)
# コマンドウィンドウをアクティブにする
@command_window.active = true
@status_window.active = false
@status_window.visible = false
@status_window.index = -1
return
end
# C ボタンが押された場合
if Input.trigger?(Input::C)
# コマンドウィンドウのカ?ソル位置で分岐
case @command_window.index
when 1 # スキル
# このアクタ?の行動制限が 2 以上の場合
if $game_party.actors[@status_window.index].restriction >= 2
# ブザ? SE を演奏
$game_system.se_play($data_system.buzzer_se)
return
end
# 決定 SE を演奏
$game_system.se_play($data_system.decision_se)
# スキル?面に切り替え
$scene = Scene_Skill.new(@status_window.index)
when 2 # ?備
# 決定 SE を演奏
$game_system.se_play($data_system.decision_se)
# ?備?面に切り替え
$scene = Scene_Equip.new(@status_window.index)
when 3 # ステ?タス
# 決定 SE を演奏
$game_system.se_play($data_system.decision_se)
# ステ?タス?面に切り替え
$scene = Scene_Status.new(@status_window.index)
end
return
end
end
end 
  
  
  
 


출처 : 게임공작소

Who's Neowitch*

?

할 짓이 없군.

Comment '17'

List of Articles
번호 분류 제목 글쓴이 날짜 조회 수
공지 스크립트 자료 게시물 작성시 주의사항 습작 2012.12.24 6203
1021 아이템 흠..몬스터도감말고 아이템도감~ 9 백호 2009.02.21 2028
1020 전투 흠.. 아직도 이 스크립트가 없군요 ㅋㅋ(제가올림..) 1 file 백호 2009.02.21 3337
1019 전투 횡스크롤형식의 스크립트 7 백호 2009.02.21 2982
1018 기타 횡스크롤 스크립트 한국말 번역. 15 file 백호 2009.02.21 3316
1017 기타 회복으로 데미지를 받는 좀비 스크립트 7 백호 2009.02.22 2010
1016 메뉴 화살표 모양 셀렉트 커서 사용 2 백호 2009.02.22 2118
1015 그래픽 화면을 부드럽게 해주는스크립트[ 아주 유용] 56 file - 하늘 - 2009.08.05 6567
1014 미니맵 화면에 축소된 미니맵을 표시하는 스크립트 - 한글 번역 - 6 file 백호 2009.02.21 2561
1013 화면에 축소된 맵을 표시하는 스크립트 7 file 백호 2009.02.21 2394
1012 기타 홈페이지 띄우기 (VX 상관없음.) 6 KNAVE 2009.08.25 2139
1011 메뉴 혹시있나해서-_-.. 대화창에 테두리치기 스크립트 7 백호 2009.02.22 2596
1010 기타 현재시간표시 33 file 코아 코스튬 2010.10.09 2529
1009 기타 현재 맵BGM을 그대로 전투 BGM으로 연결 from phylomortis.com 백호 2009.02.22 1180
1008 이름입력 한글조합입력기(영어가능) file 조규진1 2019.11.10 507
1007 메시지 한글자씩 뜨는 스크립트 6 백호 2009.02.21 3005
1006 키입력 한글입력스크립트 16 file 아방스 2007.11.09 11828
1005 키입력 한글입력기(자음, 모음 분리. 아마 중복일 듯...) 11 캉쿤 2011.09.13 3225
1004 키입력 한글입력기 6 백호 2009.02.22 4306
1003 이름입력 한글이름 입력기 스크립트 14 백호 2009.02.22 4211
1002 메시지 한글 채팅 스크립트 32 file こなた 2009.01.22 4947
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