Project1
标题:
為甚麼圖片顯示不出來了?(腳本內)
[打印本页]
作者:
PCNinja
时间:
2012-2-1 17:20
标题:
為甚麼圖片顯示不出來了?(腳本內)
=begin
==============================================================================
** MOG Scene Menu Itigo V1.5
By Moghunter
http://www.atelier-rgss.com
------------------------------------------------------------------------------
** Reinvisioned version
設定:大部份圖片也是在picture資料夾內,請自行修改。
☆這兒用角色臉圖
名稱要是「角色名稱_Fs」(默認版本,如果不喜歡請在第22行修改。)
大小要是50x50
==============================================================================
=end
module MOG
# 基本圖片名稱定義
# Main Menu Graphics Used
MAIN_LAYOUT = "Layout-Menu" # 主菜單的窗口圖
MAIN_BACKGROUND = "Back-Other" # 背景
MAIN_CURSOR = "MogCursor" # 遊標圖
MAIN_CURSOR_FX = false # 遊標移動fx開關
SECOND_CURSOR = "MogCursor_2" # 遊標圖2
SECOND_CURSOR_FX = false # 遊標2移動fx開關
FACE_SMALL = "_Fs" # 角色臉圖名稱定義
MAIN_MAPNAME = true # 如果是true就顯示地圖名稱
# Menu
MAIN_FX = 1 # 背景設定(0:活動背景/1:固定/2:地圖)
MAIN_TRAN_TIME = 20 # 畫面過渡時間
MAIN_TRAN_TYPE = "006-Stripe02" # 畫面過渡圖
# Font Used
MAIN_FONT = "華康中圓體" # 字型
# 欄位圖片名稱定義
# Empty Bars
MAIN_BAR_E = "BAR0" # HP/SP空欄圖
MAIN_BAR_XP_E = "Exp_Back" # EXP空欄圖
# Fill Bars
MAIN_BAR_HP = "HP_Bar" # HP欄填充圖
MAIN_BAR_SP = "SP_Bar" # SP欄填充圖
MAIN_BAR_XP = "Exp_Meter" # EXP欄填充圖
# Gauge Texts
MAIN_TEXT_HP = "HP_Tx" # HP美術文字
MAIN_TEXT_SP = "SP_Tx" # SP美術文字
MAIN_TEXT_XP = "Exp_tx" # EXP美術文字
MAIN_TEXT_LV = "LV_tx" # LEVEL美術文字
end
# Mogscript global
$mogscript = {} if $mogscript == nil
$mogscript["menu_itigo"] = true
#==============================================================================
# ** Game_Actor
#------------------------------------------------------------------------------
# This class handles the actor. It's used within the Game_Actors class
# ($game_actors) and refers to the Game_Party class ($game_party).
#==============================================================================
class Game_Actor < Game_Battler
def now_exp
#--------------------------------------------------------------------------
# * Get EXP
#--------------------------------------------------------------------------
return @exp - @exp_list[@level]
end
#--------------------------------------------------------------------------
# * Get Next Level EXP
#--------------------------------------------------------------------------
def next_exp
return @exp_list[@level+1] > 0 ? @exp_list[@level+1] - @exp_list[@level] : 0
end
end
#==============================================================================
# ** Game_Map
#------------------------------------------------------------------------------
# This class handles the map. It includes scrolling and passable determining
# functions. Refer to "$game_map" for the instance of this class.
#==============================================================================
class Game_Map
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_reader :map_id # map id
#--------------------------------------------------------------------------
# * Map Name
#--------------------------------------------------------------------------
def mpname
$mpname = load_data("Data/MapInfos.rxdata")
$mpname[@map_id].name
end
end
#==============================================================================
# ** Window_Base
#------------------------------------------------------------------------------
# This class is for all in-game windows.
#==============================================================================
class Window_Base < Window
#--------------------------------------------------------------------------
# * Draw Empty Face
#--------------------------------------------------------------------------
def nada
face = RPG::Cache.menu("")
end
#--------------------------------------------------------------------------
# * Draw Face
# actor : actor
# x : draw spot x-coordinate
# y : draw spot y-coordinate
#--------------------------------------------------------------------------
def drw_face(actor, x, y)
face = RPG::Cache.menu(actor.name + MOG::FACE_SMALL) rescue nada
cw = face.width
ch = face.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x , y - ch, face, src_rect)
end
#--------------------------------------------------------------------------
# * Draw HP from Image
# actor : actor
# x : draw spot x-coordinate
# y : draw spot y-coordinate
#--------------------------------------------------------------------------
def draw_maphp3(actor, x, y)
back = RPG::Cache.menu(MOG::MAIN_BAR_E)
cw = back.width
ch = back.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x + 65, y - ch + 30, back, src_rect)
meter = RPG::Cache.menu(MOG::MAIN_BAR_HP)
cw = meter.width * actor.hp / actor.maxhp
ch = meter.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x + 65, y - ch + 30, meter, src_rect)
text = RPG::Cache.menu(MOG::MAIN_TEXT_HP)
cw = text.width
ch = text.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x + 35, y - ch + 30, text, src_rect)
self.contents.font.color = Color.new(0, 0, 0, 255)
self.contents.draw_text(x + 81, y - 1, 48, 32, actor.hp.to_s, 2)
self.contents.font.color = Color.new(255, 255, 255, 255)
self.contents.draw_text(x + 80, y - 2, 48, 32, actor.hp.to_s, 2)
end
#--------------------------------------------------------------------------
# * Draw SP from Image
# actor : actor
# x : draw spot x-coordinate
# y : draw spot y-coordinate
#--------------------------------------------------------------------------
def draw_mapsp3(actor, x, y)
back = RPG::Cache.menu(MOG::MAIN_BAR_E)
cw = back.width
ch = back.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x + 65, y - ch + 30, back, src_rect)
meter = RPG::Cache.menu(MOG::MAIN_BAR_SP)
cw = meter.width * actor.sp / actor.maxsp
ch = meter.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x + 65, y - ch + 30, meter, src_rect)
text = RPG::Cache.menu(MOG::MAIN_TEXT_SP)
cw = text.width
ch = text.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x + 35, y - ch + 30, text, src_rect)
self.contents.font.color = Color.new(0, 0, 0, 255)
self.contents.draw_text(x + 81, y - 1, 48, 32, actor.sp.to_s, 2)
self.contents.font.color = Color.new(255, 255, 255, 255)
self.contents.draw_text(x + 80, y - 2, 48, 32, actor.sp.to_s, 2)
end
#--------------------------------------------------------------------------
# * Draw EXP from Image
# actor : actor
# x : draw spot x-coordinate
# y : draw spot y-coordinate
#--------------------------------------------------------------------------
def draw_mexp2(actor, x, y)
bitmap2 = RPG::Cache.menu(MOG::MAIN_BAR_XP_E)
cw = bitmap2.width
ch = bitmap2.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x + 60 , y - ch + 30, bitmap2, src_rect)
if actor.next_exp != 0
rate = actor.now_exp.to_f / actor.next_exp
else
rate = 1
end
bitmap = RPG::Cache.menu(MOG::MAIN_BAR_XP)
if actor.level < 99
cw = bitmap.width * rate
else
cw = bitmap.width
end
ch = bitmap.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x + 60 , y - ch + 30, bitmap, src_rect)
exp_tx = RPG::Cache.menu(MOG::MAIN_TEXT_XP)
cw = exp_tx.width
ch = exp_tx.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x + 55 , y - ch + 30, exp_tx, src_rect)
lv_tx = RPG::Cache.menu(MOG::MAIN_TEXT_LV)
cw = lv_tx.width
ch = lv_tx.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x + 125 , y - ch + 35, lv_tx, src_rect)
self.contents.font.color = Color.new(0, 0, 0, 255)
self.contents.draw_text(x + 161, y + 7, 24, 32, actor.level.to_s, 1)
self.contents.font.color = Color.new(255, 255, 255, 255)
self.contents.draw_text(x + 160, y + 6, 24, 32, actor.level.to_s, 1)
end
#--------------------------------------------------------------------------
# * Draw State
# actor : actor
# x : draw spot x-coordinate
# y : draw spot y-coordinate
# width : draw spot width
#--------------------------------------------------------------------------
def draw_actor_state(actor, x, y, width = 80)
text = make_battler_state_text(actor, width, true)
self.contents.font.color = actor.hp == 0 ? knockout_color : normal_color
self.contents.draw_text(x, y, width, 32, text, 2)
end
end
#==============================================================================
# ** Window_MenuStatus
#------------------------------------------------------------------------------
# This window displays party member status on the menu screen.
#==============================================================================
class Window_MenuStatus < Window_Selectable
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
super(0, 0, 415, 280)
self.contents = Bitmap.new(width - 32, height - 32)
self.windowskin = RPG::Cache.windowskin("")
self.opacity = 0
self.z = 15
refresh
self.active = false
self.index = -1
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
self.contents.clear
@item_max = $game_party.actors.size
for i in 0...$game_party.actors.size
x = 20
y = i * 62
actor = $game_party.actors[i]
self.contents.font.name = MOG::MAIN_FONT
if $mogscript["TP_System"] == true
draw_actor_tp(actor, x + 285, y - 5, 4)
draw_actor_state(actor, x + 190, y - 5)
else
draw_actor_state(actor, x + 220, y - 5)
end
drw_face(actor, x, y + 50)
draw_maphp3(actor, x + 40, y - 5)
draw_mapsp3(actor, x + 40, y + 20)
draw_mexp2(actor, x + 140, y + 15)
end
end
#--------------------------------------------------------------------------
# * Cursor Rectangle Update
#--------------------------------------------------------------------------
def update_cursor_rect
if @index < 0
self.cursor_rect.empty
else
self.cursor_rect.set(5, @index * 62, self.width - 32, 50)
end
end
end
#==============================================================================
# ** Window_Gold
#------------------------------------------------------------------------------
# This window displays amount of gold.
#==============================================================================
class Window_Gold < Window_Base
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
super(0, 0, 160, 64)
self.contents = Bitmap.new(width - 32, height - 32)
self.windowskin = RPG::Cache.windowskin("")
self.opacity = 0
self.z = 15
refresh
end
def refresh
self.contents.clear
self.contents.font.size = 15
cx = contents.text_size($data_system.words.gold).width
self.contents.font.color = normal_color
self.contents.draw_text(0, 0, 120-cx-2, 32, $game_party.gold.to_s, 2)
self.contents.font.color = system_color
self.contents.draw_text(120-cx, 0, cx, 32, $data_system.words.gold, 2)
end
end
#==============================================================================
# ** Window_PlayTime
#------------------------------------------------------------------------------
# This window displays play time on the menu screen.
#==============================================================================
class Window_PlayTime < Window_Base
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
super(0, 0, 160, 96)
self.contents = Bitmap.new(width - 32, height - 32)
self.windowskin = RPG::Cache.windowskin("")
self.opacity = 0
self.z = 15
refresh
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
self.contents.clear
self.contents.font.size = 15
@total_sec = Graphics.frame_count / Graphics.frame_rate
hour = @total_sec / 60 / 60
min = @total_sec / 60 % 60
sec = @total_sec % 60
text = sprintf("%02d:%02d:%02d", hour, min, sec)
self.contents.font.color = normal_color
self.contents.draw_text(0, 0, 120, 32, text, 2)
end
end
#==============================================================================
# ** Window_Steps
#------------------------------------------------------------------------------
# This window displays step count on the menu screen.
#==============================================================================
class Window_Steps < Window_Base
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
super(0, 0, 160, 96)
self.contents = Bitmap.new(width - 32, height - 32)
self.windowskin = RPG::Cache.windowskin("")
self.opacity = 0
self.z = 15
refresh
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
self.contents.clear
self.contents.font.size = 15
self.contents.font.color = normal_color
self.contents.draw_text(0, 0, 120, 32, $game_party.steps.to_s, 2)
end
end
#==============================================================================
# ** Window_Map_Name
#------------------------------------------------------------------------------
# This window displays the map name on the menu screen.
#==============================================================================
class Window_Map_Name < Window_Base
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
super(0, 0, 160, 96)
self.contents = Bitmap.new(width - 32, height - 32)
self.windowskin = RPG::Cache.windowskin("")
self.opacity = 0
self.z = 15
refresh
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
self.contents.clear
self.contents.font.color = normal_color
self.contents.draw_text(4, 32, 120, 32, $game_map.mpname.to_s, 1)
end
end
#==============================================================================
# ** Scene_Menu
#------------------------------------------------------------------------------
# This class performs menu screen processing.
#==============================================================================
class Scene_Menu
#--------------------------------------------------------------------------
# * Main Processing
#--------------------------------------------------------------------------
def main
s1 = ""
s2 = ""
s3 = ""
s4 = ""
s5 = ""
s6 = ""
@command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6])
@command_window.index = @menu_index
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.visible = false
@command_window.x = -640
#layout
@mnlay = Sprite.new
@mnlay.bitmap = RPG::Cache.menu(MOG::MAIN_LAYOUT)
@mnlay.z = 10
@mnlay.opacity = 0
@mnlay.x = 0
#background
if MOG::MAIN_FX == 0
@mnback = Plane.new
@mnback.bitmap = RPG::Cache.menu(MOG::MAIN_BACKGROUND)
@mnback.blend_type = 0
@mnback.z = 5
@mnback2 = Plane.new
@mnback2.bitmap = RPG::Cache.menu(MOG::MAIN_BACKGROUND)
@mnback2.blend_type = 0
@mnback2.z = 5
@mnback2.opacity = 60
elsif MOG::MAIN_FX == 1
@mnback = Plane.new
@mnback.bitmap = RPG::Cache.menu(MOG::MAIN_BACKGROUND)
@mnback.blend_type = 0
@mnback.z = 5
else
@spriteset = Spriteset_Map.new
end
#cursor
@mnsel = Sprite.new
@mnsel.bitmap = RPG::Cache.menu(MOG::MAIN_CURSOR)
@mnsel.z = 20
@mnsel.x = 40
@mnsel.y = 112
@mnop = 150
if $game_system.save_disabled
@command_window.disable_item(4)
end
# 章程
case $game_variables[3]
when 1
@stage = "1"
else
@stage = "1"
end
@menu_stage = Sprite.new
@menu_stage.bitmap = RPG::Cache.menu("#{@stage}")
@menu_stage.zoom_x = 0.4
@menu_stage.zoom_y = 0.4
@menu_stage.z = 100
@menu_stage.opacity = 200
@menu_stage.x = -56
@menu_stage.y = -329
#
@playtime_window = Window_PlayTime.new
@playtime_window.x = -15#54
@playtime_window.y = 60#68
@playtime_window.contents_opacity = 0
if MOG::MAIN_MAPNAME == true
@mapname_window = Window_Map_Name.new
@mapname_window.x = 425
@mapname_window.y = 25
@mapname_window.contents_opacity = 0
end
#(X: - <=, + =>), (y: +v, - ^)
@steps_window = Window_Steps.new
@steps_window.x = -69#54
@steps_window.y = 44#88
@steps_window.contents_opacity = 0
@gold_window = Window_Gold.new
@gold_window.x = -59#54
@gold_window.y = 25#48
@gold_window.contents_opacity = 0
@status_window = Window_MenuStatus.new
@status_window.x = 295
@status_window.y = 110
@status_window.contents_opacity = 0
if MOG::MAIN_FX == 0
Graphics.transition(MOG::MAIN_TRAN_TIME, "Graphics/Transitions/" +
MOG::MAIN_TRAN_TYPE)
elsif MOG::MAIN_FX == 1
Graphics.transition(MOG::MAIN_TRAN_TIME, "Graphics/Transitions/" +
MOG::MAIN_TRAN_TYPE)
else
Graphics.transition
end
loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end
for i in 0..10
if MOG::MAIN_FX == 0
@mnback.oy += 1
@mnback.ox += 1
@mnback2.oy += 1
@mnback2.ox -= 1
end
@status_window.x += 20
@status_window.contents_opacity -= 25
@mnsel.opacity -= 25
@mnsel.zoom_x += 0.03
@mnlay.x -= 0 #10
@mnlay.opacity = 255 #-=25
if MOG::MAIN_MAPNAME == true
@mapname_window.x += 5
@mapname_window.contents_opacity -= 20
end
@steps_window.contents_opacity -= 25
@gold_window.contents_opacity -= 25
@playtime_window.contents_opacity -= 25
Graphics.update
end
Graphics.freeze
@command_window.dispose
@playtime_window.dispose
@steps_window.dispose
@gold_window.dispose
@status_window.dispose
@menu_stage.dispose
@mnlay.dispose
if MOG::MAIN_FX == 0
@mnback.dispose
@mnback2.dispose
elsif MOG::MAIN_FX == 1
@mnback.dispose
else
@spriteset.dispose
end
@mnsel.dispose
@mapname_window.dispose if MOG::MAIN_MAPNAME == true
Graphics.update
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
if MOG::MAIN_CURSOR_FX
if @mnsel.zoom_x <= 1.6
@mnsel.zoom_x += 0.03
@mnsel.opacity -= 10
elsif @mnsel.zoom_x > 1.6
@mnsel.zoom_x = 1.0
@mnsel.opacity = 255
end
end
if @mnlay.x < 0
@mnlay.opacity = 255 #25
@mnlay.x += 10
elsif @mnlay.x >= 0
@mnlay.opacity = 255
@mnlay.x = 0
end
@command_window.update if @command_window.active
@playtime_window.update
@status_window.update if @status_window.active
if MOG::MAIN_FX == 0
@mnback.oy += 1
@mnback.ox += 1
@mnback2.oy += 1
@mnback2.ox -= 1
end
@mnop += 5
# Secondary Cursor
if @command_window.active == true
@mnsel.bitmap = RPG::Cache.menu(MOG::MAIN_CURSOR)
else
@mnsel.bitmap = RPG::Cache.menu(MOG::SECOND_CURSOR)
unless MOG::SECOND_CURSOR_FX
@mnsel.zoom_x = 1
@mnsel.opacity = 255
end
end
@mapname_window.contents_opacity += 15 if MOG::MAIN_MAPNAME == true
@playtime_window.contents_opacity += 15
@gold_window.contents_opacity += 15
@playtime_window.contents_opacity += 15
@steps_window.contents_opacity += 15
if @status_window.x > 195
@status_window.x -= 10
@status_window.contents_opacity += 10
elsif @status_window.x <= 195
@status_window.x = 195
@status_window.contents_opacity = 255
end
if @mnop >= 255
@mnop = 120
end
if @command_window.active
update_command
return
end
if @status_window.active
update_status
return
end
end
#--------------------------------------------------------------------------
# * Frame Update (when command window is active)
#--------------------------------------------------------------------------
def update_command
case @command_window.index
when 0
@mnsel.x = 40
@mnsel.y = 112
when 1
@mnsel.x = 40
@mnsel.y = 162
when 2
@mnsel.x = 40
@mnsel.y = 209
when 3
@mnsel.x = 40
@mnsel.y = 255
when 4
@mnsel.x = 40
@mnsel.y = 303
when 5
@mnsel.x = 40
@mnsel.y = 348
end
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
$scene = Scene_Map.new
return
end
if Input.trigger?(Input::C)
if $game_party.actors.size == 0 and @command_window.index < 4
$game_system.se_play($data_system.buzzer_se)
return
end
case @command_window.index
when 0
$game_system.se_play($data_system.decision_se)
$scene = Scene_Item.new
when 1
$game_system.se_play($data_system.decision_se)
@command_window.active = false
@status_window.active = true
@status_window.index = 0
when 2
$game_system.se_play($data_system.decision_se)
@command_window.active = false
@status_window.active = true
@status_window.index = 0
when 3
$game_system.se_play($data_system.decision_se)
@command_window.active = false
@status_window.active = true
@status_window.index = 0
when 4
if $game_system.save_disabled
$game_system.se_play($data_system.buzzer_se)
return
end
$game_system.se_play($data_system.decision_se)
$scene = Scene_Save.new
when 5
$game_system.se_play($data_system.decision_se)
$scene = Scene_End.new
end
return
end
end
#--------------------------------------------------------------------------
# * Frame Update (when status window is active)
#--------------------------------------------------------------------------
def update_status
case @status_window.index
when 0
@mnsel.x = 180
@mnsel.y = 130
when 1
@mnsel.x = 180
@mnsel.y = 195
when 2
@mnsel.x = 180
@mnsel.y = 255
when 3
@mnsel.x = 180
@mnsel.y = 320
end
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
@command_window.active = true
@status_window.active = false
@status_window.index = -1
return
end
if Input.trigger?(Input::C)
case @command_window.index
when 1
if $game_party.actors[@status_window.index].restriction >= 2
$game_system.se_play($data_system.buzzer_se)
return
end
$game_system.se_play($data_system.decision_se)
$scene = Scene_Skill.new(@status_window.index)
when 2
$game_system.se_play($data_system.decision_se)
$scene = Scene_Equip.new(@status_window.index)
when 3
$game_system.se_play($data_system.decision_se)
$scene = Scene_Status.new(@status_window.index)
end
return
end
end
end
复制代码
http://www.atelier-rgss.com/RGSS/Menu/XP_Menu01.html
←原版
這個是我修改過的MoGHUNTER menu,我想加入一個顯示章程的圖片 (約487行開始)不過為甚魔顯示不出來了啦!!而且角色臉圖也不見了!! >< (自認腳本盲)
附圖1張:
prefer.png
(341.94 KB, 下载次数: 3)
下载附件
保存到相册
2012-2-1 17:18 上传
(素材是不是很熟悉呢~(就是淚光的圖啦...對不起明尼君)當然那個[通往青空的道路](就是現實中會消失的圖)會改的)
dsu_plus_rewardpost_czw
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1