Project1
标题:
如何在游戏进入界面前显示图片?
[打印本页]
作者:
ballance
时间:
2010-7-27 16:31
标题:
如何在游戏进入界面前显示图片?
RT
作者:
wsmyzc
时间:
2010-7-27 16:49
。。你能搜索一下或者描述清楚点吗?
作者:
droglo
时间:
2010-7-27 19:15
进入界面是按ESC的时候么
作者:
maliut
时间:
2010-7-27 19:55
按F1,脚本入门,基础篇,图片
作者:
小幽的马甲
时间:
2010-7-27 19:58
适时建立个精灵就好,不过进入界面是指什么?
作者:
wingtang5
时间:
2010-7-28 08:58
本帖最后由 wingtang5 于 2010-7-28 09:22 编辑
准备4张图片放在pictures
分别是:
新的开始_2
新的开始_1
读取游戏_2
读取游戏_1
离开游戏_1
离开游戏_2
脚本在Main 前面插入
#==============================================================================
# [RMVX] +VX标题画面随机变化+
#------------------------------------------------------------------------------
# 版本 1.0
# 原作者: Woratana [
[email protected]
]
# 发布日期: 07/02/2008
# 汉化:zero2
#
# 这个脚本会随机标题画面
#
# 您还可以设置标题画面的照片还可以通过随机线:
# 标题 = ["文件1","文件2","文件3",...]
# 标题画面图片,必须在文件夹中的"System"
#
# 例如, 标题 = ["Screenfire","Title1"]
# >> 标题画面,将随机选其一做为标题画面 "Screenfire" and "Title1".
#=============================================================================
class Scene_Title < Scene_Base
Title = Array.new
# 将要使用标题屏幕画面随机在这里设置!!
Title = ["Title","Title10","Title25","Title50","Title80"]
def create_title_graphic
@sprite = Sprite.new
title_random = rand(Title.size)
@sprite.bitmap = Cache.system(Title[title_random].to_s)
end
end
复制代码
作者:
仲秋启明
时间:
2010-7-28 10:42
加LOGO?
#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
#_/ ◆ タイトル画面演出 - KGC_TitleDirection ◆ VX ◆
#_/ ◇ Last update : 2008/09/06 ◇
#_/----------------------------------------------------------------------------
#_/ タイトル画面に様々な演出を追加します。
#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
#==============================================================================
# ★ カスタマイズ項目 - Customize ★
#==============================================================================
module KGC
module TitleDirection
# ◆ BGM の開始タイミング
# 0..ロゴ表示前 1..ロゴ表示後
BGM_TIMING = 1
# ◆ テストプレイでもロゴを表示
TESTPLAY_SHOW = false
# ◆ スプラッシュロゴ画像ファイル名(nil で解除)
# "Graphics/System" から読み込む。
# これを解除すると「ロゴ表示 SE」も無効。
SPLASH_LOGO_FILE = "Logo"
# ◆ スプラッシュロゴ表示 SE (nil で解除)
# ファイル名表記 SPLASH_LOGO_SE = "start_logo"
# クラス表記 SPLASH_LOGO_SE = RPG::SE.new("start_logo", 80, 100)
# の2方式に対応。
SPLASH_LOGO_SE = nil
# ◆ スプラッシュロゴ演出形式
# 0..フェード 1..クロス 2..ズーム 3..スプラッシュ
SPLASH_LOGO_TYPE = 3
end
end
#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
$imported = {} if $imported == nil
$imported["TitleDirection"] = true
#==============================================================================
# □ Sprite_TitleLogo
#------------------------------------------------------------------------------
# タイトル画面のロゴを扱うクラスです。
#==============================================================================
class Sprite_TitleLogo < Sprite
attr_accessor :effect_no_out # 消去エフェクトなし
#--------------------------------------------------------------------------
# ● オブジェクト初期化
#--------------------------------------------------------------------------
def initialize
super
@effect_type = 0
@effect_duration = 0
@effect_sprites = []
@effect_no_out = false
end
#--------------------------------------------------------------------------
# ● 破棄
#--------------------------------------------------------------------------
def dispose
super
dispose_effect_sprites
end
#--------------------------------------------------------------------------
# ○ エフェクト用スプライト破棄
#--------------------------------------------------------------------------
def dispose_effect_sprites
@effect_sprites.each { |s| s.dispose }
@effect_sprites = []
end
#--------------------------------------------------------------------------
# ● Z 座標変更
#--------------------------------------------------------------------------
def z=(value)
super(value)
@effect_sprites.each { |s| s.z = value }
end
#--------------------------------------------------------------------------
# ○ フェード効果
# dx : X 座標
# dy : Y 座標
# bitmap : 表示画像
#--------------------------------------------------------------------------
def effect_fade(dx, dy, bitmap)
dispose_effect_sprites
@effect_type = 0
@effect_duration = 150
# スプライト作成
sprite = Sprite.new
sprite.bitmap = bitmap
# 表示位置を調整
sprite.x = dx
sprite.y = dy
sprite.ox = bitmap.width / 2
sprite.oy = bitmap.height / 2
sprite.opacity = 0
@effect_sprites << sprite
end
#--------------------------------------------------------------------------
# ○ クロス効果
#--------------------------------------------------------------------------
def effect_cross(dx, dy, bitmap)
dispose_effect_sprites
@effect_type = 1
@effect_duration = 150
# スプライト作成
sprites = [Sprite.new, Sprite.new]
sprites[0].bitmap = bitmap
sprites[1].bitmap = bitmap
# 表示位置を調整
sprites[0].x = dx - 240
sprites[1].x = dx + 240
sprites[0].y = dy
sprites[1].y = dy
sprites[0].ox = sprites[1].ox = bitmap.width / 2
sprites[0].oy = sprites[1].oy = bitmap.height / 2
sprites[0].opacity = 0
sprites[1].opacity = 0
@effect_sprites += sprites
end
#--------------------------------------------------------------------------
# ○ ズーム効果
#--------------------------------------------------------------------------
def effect_zoom(dx, dy, bitmap)
dispose_effect_sprites
@effect_type = 2
@effect_duration = 150
# スプライト作成
sprites = [Sprite.new, Sprite.new]
sprites[0].bitmap = bitmap
sprites[1].bitmap = bitmap
# 初期設定
sprites[0].x = sprites[1].x = dx
sprites[0].y = sprites[1].y = dy
sprites[0].ox = sprites[1].ox = bitmap.width / 2
sprites[0].oy = sprites[1].oy = bitmap.height / 2
sprites[0].zoom_x = sprites[0].zoom_y = 0.0
sprites[1].zoom_x = sprites[1].zoom_y = 6.0
sprites[0].opacity = sprites[1].opacity = 0
@effect_sprites += sprites
end
#--------------------------------------------------------------------------
# ○ スプラッシュ効果
#--------------------------------------------------------------------------
def effect_splash(dx, dy, bitmap)
dispose_effect_sprites
@effect_type = 3
@effect_duration = 150
# スプライト作成
sprites = [Sprite.new]
sprites[0].bitmap = bitmap
# 初期設定
sprites[0].ox = bitmap.width >> 1
sprites[0].oy = bitmap.height >> 1
sprites[0].x = dx
sprites[0].y = dy
sprites[0].opacity = 0
(1..3).each { |i|
sprites[i] = Sprite.new
sprites[i].bitmap = bitmap
sprites[i].ox = sprites[0].ox
sprites[i].oy = sprites[0].oy
sprites[i].x = dx
sprites[i].y = dy
sprites[i].opacity = 255
sprites[i].visible = false
}
@effect_sprites += sprites
end
#--------------------------------------------------------------------------
# ○ スプラッシュイン効果
#--------------------------------------------------------------------------
def effect_splash_in(dx, dy, bitmap)
dispose_effect_sprites
@effect_type = 4
@effect_duration = 41
# スプライト作成
sprites = [Sprite.new]
sprites[0].bitmap = bitmap
# 初期設定
sprites[0].ox = bitmap.width >> 1
sprites[0].oy = bitmap.height >> 1
sprites[0].x = dx - 160
sprites[0].y = dy - 160
sprites[0].opacity = 0
(1..3).each { |i|
sprites[i] = Sprite.new
sprites[i].bitmap = bitmap
sprites[i].ox = sprites[0].ox
sprites[i].oy = sprites[0].oy
sprites[i].x = dx
sprites[i].y = dy
sprites[i].opacity = 0
}
sprites[1].x += 160
sprites[1].y -= 160
sprites[2].x += 160
sprites[2].y += 160
sprites[3].x -= 160
sprites[3].y += 160
@effect_sprites += sprites
end
#--------------------------------------------------------------------------
# ○ エフェクト停止
#--------------------------------------------------------------------------
def stop_effect
dispose_effect_sprites
@effect_duration = 0
end
#--------------------------------------------------------------------------
# ○ エフェクト実行中判定
#--------------------------------------------------------------------------
def effect?
return @effect_duration > 0
end
#--------------------------------------------------------------------------
# ● フレーム更新
#--------------------------------------------------------------------------
def update
super
if @effect_duration > 0
update_effect
end
end
#--------------------------------------------------------------------------
# ○ エフェクト更新
#--------------------------------------------------------------------------
def update_effect
@effect_duration -= 1
case @effect_type
when 0
update_effect_fade
when 1
update_effect_cross
when 2
update_effect_zoom
when 3
update_effect_splash
when 4
update_effect_splash_in
end
end
#--------------------------------------------------------------------------
# ○ エフェクト更新 : フェード
#--------------------------------------------------------------------------
def update_effect_fade
case @effect_duration
when 100...150
@effect_sprites[0].opacity += 6
when 30...100
# 何もしない
when 0...30
unless @effect_no_out
@effect_sprites[0].opacity -= 10
end
end
end
#--------------------------------------------------------------------------
# ○ エフェクト更新 : クロス
#--------------------------------------------------------------------------
def update_effect_cross
case @effect_duration
when 110...150
@effect_sprites[0].x += 6
@effect_sprites[1].x -= 6
@effect_sprites[0].opacity += 4
@effect_sprites[1].opacity += 4
when 30...110
@effect_sprites[0].opacity = 255
@effect_sprites[1].visible = false
when 0...30
unless @effect_no_out
@effect_sprites[0].opacity -= 13
end
end
end
#--------------------------------------------------------------------------
# ○ エフェクト更新 : ズーム
#--------------------------------------------------------------------------
def update_effect_zoom
case @effect_duration
when 100...150
@effect_sprites[0].zoom_x = (@effect_sprites[0].zoom_y += 0.02)
@effect_sprites[1].zoom_x = (@effect_sprites[1].zoom_y -= 0.1)
@effect_sprites[0].opacity += 3
@effect_sprites[1].opacity += 3
when 30...100
@effect_sprites[0].opacity = 255
@effect_sprites[1].visible = false
when 0...30
unless @effect_no_out
@effect_sprites[0].opacity -= 13
end
end
end
#--------------------------------------------------------------------------
# ○ エフェクト更新 : スプラッシュ
#--------------------------------------------------------------------------
def update_effect_splash
case @effect_duration
when 90...150
@effect_sprites[0].opacity += 5
when 0...60
@effect_sprites[0].x -= 2
@effect_sprites[0].y -= 2
@effect_sprites[1].x += 2
@effect_sprites[1].y -= 2
@effect_sprites[2].x += 2
@effect_sprites[2].y += 2
@effect_sprites[3].x -= 2
@effect_sprites[3].y += 2
4.times { |j|
@effect_sprites[j].visible = true
@effect_sprites[j].opacity -= 5
}
end
end
#--------------------------------------------------------------------------
# ○ エフェクト更新 : スプラッシュイン
#--------------------------------------------------------------------------
def update_effect_splash_in
case @effect_duration
when 1...41
@effect_sprites[0].x += 2
@effect_sprites[0].y += 2
@effect_sprites[1].x -= 2
@effect_sprites[1].y += 2
@effect_sprites[2].x -= 2
@effect_sprites[2].y -= 2
@effect_sprites[3].x += 2
@effect_sprites[3].y -= 2
4.times { |j|
@effect_sprites[j].opacity += 3
}
when 0
@effect_sprites[0].opacity = 255
(1..3).each { |i|
@effect_sprites[i].visible = false
}
end
end
end
#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
#==============================================================================
# ■ Scene_Title
#==============================================================================
class Scene_Title < Scene_Base
#--------------------------------------------------------------------------
# ● 開始処理
#--------------------------------------------------------------------------
alias start_KGC_TitleDirection start
def start
show_splash_logo
start_KGC_TitleDirection
end
#--------------------------------------------------------------------------
# ○ スプラッシュロゴ表示
#--------------------------------------------------------------------------
def show_splash_logo
return if $__splash_logo_shown
return if $TEST && !KGC::TitleDirection::TESTPLAY_SHOW
return if KGC::TitleDirection::SPLASH_LOGO_FILE == nil
play_title_music if KGC::TitleDirection::BGM_TIMING == 0
# ロゴ表示 SE 演奏
if KGC::TitleDirection::SPLASH_LOGO_SE != nil
if KGC::TitleDirection::SPLASH_LOGO_SE.is_a?(RPG::SE)
KGC::TitleDirection::SPLASH_LOGO_SE.play
elsif KGC::TitleDirection::SPLASH_LOGO_SE.is_a?(String)
se = RPG::SE.new(KGC::TitleDirection::SPLASH_LOGO_SE)
se.play
end
end
# エフェクト用スプライト作成
sprite = Sprite_TitleLogo.new
bitmap = Cache.system(KGC::TitleDirection::SPLASH_LOGO_FILE)
dx = Graphics.width / 2
dy = Graphics.height / 2
# エフェクト準備
case KGC::TitleDirection::SPLASH_LOGO_TYPE
when 0
sprite.effect_fade(dx, dy, bitmap)
when 1
sprite.effect_cross(dx, dy, bitmap)
when 2
sprite.effect_zoom(dx, dy, bitmap)
when 3
sprite.effect_splash(dx, dy, bitmap)
end
# エフェクト実行
Graphics.transition(0)
while sprite.effect?
Graphics.update
Input.update
sprite.update
# C ボタンで中止
if Input.trigger?(Input::C)
sprite.stop_effect
RPG::SE.stop
end
end
# 後始末
sprite.dispose
bitmap.dispose
# トランジション準備
Graphics.freeze
$__splash_logo_shown = true
end
end
复制代码
作者:
小闵
时间:
2010-7-28 17:42
搞个跳过标题的脚本,在事件里做到LZ所说的显示图片,之后才在事件里设回到标题
界面,OK...
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1