- Сообщений: 132
- Спасибо получено: 64
Помощь в изменении скрипта показа главного меню
Долго сам старался разобраться.. но увы в Руби скриптинге я еще хуже чем в рисовании..)
Есть 2 скрипта отображения главного меню (это там где Новая игра, Продолжить и Выход) MOG - Madoka Title Screen (v1.0) и MOG - Animated Title A (v2.3)
От первого мне нужна функция отображения команд (картинками). Чтобы отображался непосредственно только 1 пункт а не все сразу.
От второго, собственно, все остальное, но убрать не нужные функции:
* RANDOM_PICTURES, изменить на 1 конкретное статическое изображение (фон меню)
* убрать Частицы (particles)
* убрать WAVE TITLE
* убрать эффект тумана
* Убрать оба вида курсора, которые там используются
* Добавить функцию, либо пишется текст, либо рисуется картинка внизу экрана, в зависимости от выбранной команды. Например, для команды Новая игра будет написано: Начинает историю заново новым персонажем.
Для продолжить - Загружает и продолжает выбранную историю, и для выйти - что-то третье)
В общем, хочется в итоге видеть что-то подобное на экране:
Исходники MOG - Madoka Title Screen (v1.0)
# +++ MOG - Madoka Title Screen (v1.0) +++ /人◕ ‿‿ ◕人\
#==============================================================================
# By Moghunter
# www.atelier-rgss.com/
#==============================================================================
# Tela de titulo animado com o tema do anime Puella Magi Madoka Magica.
# Naturalmente você pode colocar qualquer personagem.
#==============================================================================
module MOG_MADOKA_TITLE_SCREEN
#Posição do titulo.
TITLE_POSITION = [40,270]
#Velocidade de deslize da imagem de fundo.
BACKGROUND_SCROLL_SPEED = [1,0]
#Posição do circulo mágico
CIRCLE_POSITION = [-30,-30]
#Valor do zoom do circulo mágico. (Valores altos causam Lag)
CIRCLE_ZOOM_RANGE = 3
#Definição do tipo de blend do circulo mágico.
CIRCLE_BLEND_TYPE = 0
#Imagens dos characteres que terão o efeito de Zoom.
# CHARACTES_SPRITES_ZOOM_EFFECT = [0,2,5]
CHARACTES_SPRITES_ZOOM_EFFECT = [0]
#Prioridade dos personagens
CHARACTER_Z = 10
# Ativar Partículas.
PARTICLES = true
# Numero de partículas.
PARTICLE_NUMBER = 15
# Ativar Cores Aleatórias.
PARTICLE_RANDOM_COLOR = false
# Definição do tipo de blend. (0,1,2)
PARTICLE_BLEND_TYPE = 0
#Definição do limite de velocidade das partículas.
PARTICLE_MOVEMENT_RANGE_X = 0
PARTICLE_MOVEMENT_RANGE_Y = 3
PARTICLE_ANGLE_RANGE = 3
PARTICLE_Z = 25
#Posição do comando
COMMAND_POSITION = [20,50]
#Prioridade do comando
COMMNAND_Z = 100
end
#==============================================================================
# ■ Particle Title
#==============================================================================
class Particle_Title < Sprite
include MOG_MADOKA_TITLE_SCREEN
#
# ● Initialize
#
def initialize(viewport = nil)
super(viewport)
self.bitmap = Cache.title1("Particle")
self.tone.set(rand(255),rand(255), rand(255), 255) if PARTICLE_RANDOM_COLOR
self.blend_type = PARTICLE_BLEND_TYPE
self.z = PARTICLE_Z
@cw = self.bitmap.width
@ch = self.bitmap.height
@nx = PARTICLE_MOVEMENT_RANGE_X
@ny = PARTICLE_MOVEMENT_RANGE_Y
reset_setting
end
#
# ● Reset Setting
#
def reset_setting
zoom = (50 + rand(100)) / 100.1
self.zoom_x = zoom
self.zoom_y = zoom
self.x = (rand(576) -32)
self.y = rand(448 + @ch)
self.opacity = 0
self.angle = rand(360)
nx2 = rand(@nx).abs
nx2 = 1 if (@nx != 0 and nx2 < 1)
@speed_x = @nx > 0 ? nx2 : @nx < 0 ? -nx2 : 0
ny2 = rand(@ny).abs
ny2 = 1 if (@ny != 0 and ny2 < 1)
@speed_y = @ny > 0 ? ny2 : @ny < 0 ? -ny2 : 0
@speed_a = [[rand(PARTICLE_ANGLE_RANGE), PARTICLE_ANGLE_RANGE].min, 0].max
end
#
# ● Dispose
#
def dispose
super
self.bitmap.dispose
end
#
# ● Update
#
def update
super
self.x += @speed_x
self.y -= @speed_y
self.angle += @speed_a
self.opacity += 5
reset_setting if can_reset_setting?
end
#
# ● Can Reset Setting
#
def can_reset_setting?
return true if (self.x < -64 or self.x > 592)
return true if (self.y < -164 or self.y > 464)
return false
end
end
#==============================================================================
# ■ Scene Title
#==============================================================================
class Scene_Title < Scene_Base
include MOG_MADOKA_TITLE_SCREEN
#
# ● Start
#
def start
super
SceneManager.clear
play_title_music
@phase = 0
@skip_wait = 0
create_srites
end
#
# ● トランジション速度の取得
#
def transition_speed
return 20
end
#
# ● Terminate
#
def terminate
super
execute_dispose
end
#
# ● Update
#
def update
super
execute_update
end
#
# ● Create Sprites
#
def create_srites
execute_dispose
create_background
create_characters_sprites
create_title_name
create_magic_circle
create_particles
create_commands
end
#
# ● Create Commands
#
def create_commands
@command_wait = false
@command_index = 0
@command_index = 1 if DataManager.save_file_exists?
@commands = []
index = 0
for i in 0..2
@commands[index] = Sprite.new
if index == 1 and !DataManager.save_file_exists?
@commands[index].bitmap = Cache.title1("Command" + index.to_s + "B")
else
@commands[index].bitmap = Cache.title1("Command" + index.to_s)
end
@commands[index].z = COMMNAND_Z
@commands[index].ox = @commands[index].bitmap.width / 2
@commands[index].oy = @commands[index].bitmap.height / 2
@commands[index].x = COMMAND_POSITION[0] + @commands[index].ox
@commands[index].y = COMMAND_POSITION[1] + @commands[index].oy
@commands[index].opacity = 0
index += 1
end
end
#
# ● Create Background
#
def create_background
@background = Plane.new
@background.bitmap = Cache.title1("Background")
@background.z = 0
end
#
# ● Create Title Name
#
def create_title_name
@title_name_effect = [0,30]
@title_name = Sprite.new
@title_name.bitmap = Cache.title1("Title_Name")
@title_name.z = 301
@title_name.opacity = 255
@title_name.blend_type = 0
@title_name.ox = @title_name.bitmap.width / 2
@title_name.oy = @title_name.bitmap.height / 2
@title_name.x = TITLE_POSITION[0] + @title_name.ox
@title_name.y = TITLE_POSITION[1] + @title_name.oy
end
#
# ● Create Magic Circle
#
def create_magic_circle
@magic_circle = Sprite.new
@magic_circle.bitmap = Cache.title1("Magic_Circle")
@magic_circle.z = 100
@magic_circle.ox = @magic_circle.bitmap.width / 2
@magic_circle.oy =@magic_circle.bitmap.height / 2
@magic_circle.x = @magic_circle.ox - CIRCLE_POSITION[0]
@magic_circle.y = @magic_circle.oy - CIRCLE_POSITION[1]
@magic_circle.z = 3
@magic_circle.zoom_x = CIRCLE_ZOOM_RANGE
@magic_circle.zoom_y = CIRCLE_ZOOM_RANGE
@magic_circle.opacity = 0
@magic_circle.blend_type = CIRCLE_BLEND_TYPE
end
#
# ● Create Characters Sprites
#
def create_characters_sprites
@magic_girls_appear_duration = 0
@magic_girl_index = 0
@magic_girls = []
@magic_girls
index = 0
for i in 0..999
@magic_girls = Sprite.new
@magic_girls.bitmap = Cache.title1("Character" + index.to_s) rescue nil
if @magic_girls.bitmap == nil
@magic_girls.dispose
@magic_girls.delete(index)
break
end
@magic_girls.z = CHARACTER_Z + index
@magic_girls.opacity = 0
@magic_girls.ox = @magic_girls.bitmap.width / 2
@magic_girls.oy = @magic_girls.bitmap.height / 2
@magic_girls.x = @magic_girls.ox
@magic_girls.y = @magic_girls.oy
if CHARACTES_SPRITES_ZOOM_EFFECT.include?(index)
@magic_girls.zoom_x = 1.5
@magic_girls.zoom_y = 1.5
end
index += 1
end
@magic_girls.pop
end
#
# ● Create Particles
#
def create_particles
return if !PARTICLES
@viewport_light = Viewport.new(-32, -32, 600, 480)
@viewport_light.z = PARTICLE_Z
@particles_bitmap =[]
for i in 0...PARTICLE_NUMBER
@particles_bitmap.push(Particle_Title.new, @viewport_light)
end
end
#
# ● Execute Dispose
#
def execute_dispose
dispose_background
dispose_title_name
dispose_characters
dispose_particles
dispose_commands
dispose_circle
end
#
# ● Dispose Background
#
def dispose_background
return if @background == nil
@background.bitmap.dispose
@background.dispose
@background = nil
end
#
# ● Dispose Tittle Name
#
def dispose_title_name
return if @title_name == nil
@title_name.bitmap.dispose
@title_name.dispose
@title_name = nil
end
#
# ● Dispose Characters
#
def dispose_characters
return if @magic_girls == nil
for i in @magic_girls
if i.bitmap != nil
i.bitmap.dispose
end
i.dispose
end
@magic_girls = nil
end
#
# ● Dispose Particles
#
def dispose_particles
return if @particles_bitmap == nil
@particles_bitmap.each {|sprite| sprite.dispose }
@particles_bitmap = nil
@viewport_light.dispose
end
#
# ● Dispose Command
#
def dispose_commands
return if @commands == nil
@commands.each {|sprite| sprite.dispose }
@commands = nil
end
#
# ● Dispose Circle
#
def dispose_circle
return if @magic_circle == nil
@magic_circle.bitmap.dispose
@magic_circle.dispose
@magic_circle = nil
end
#
# ● Execute Update
#
def execute_update
update_characters
update_title_name
update_magic_circle
update_particles
update_command
update_background
end
#
# ● Create Background
#
def update_background
return if @background == nil
@background.ox += BACKGROUND_SCROLL_SPEED[0]
@background.oy += BACKGROUND_SCROLL_SPEED[1]
end
#
# ● Update Characters
#
def update_characters
return if @magic_girls == nil
index = 0
for i in @magic_girls
update_magic_girls(i,index)
index += 1
end
end
#
# ● Update Magic Girls
#
def update_magic_girls(i,index)
return if @magic_girl_index != index
update_zoom_effect(i,index) if CHARACTES_SPRITES_ZOOM_EFFECT.include?(index)
update_opactiy_effect(i,index)
end
#
# ● Update Opacity Effect
#
def update_opactiy_effect(i,index)
i.opacity += 5
return if i.opacity < 255
i.zoom_x = 1.00
i.zoom_y = 1.00
@magic_girl_index += 1
if @magic_girl_index == @magic_girls.size
@phase = 1
clear_command_sprites
end
end
#
# ● Update Zoom Effect
#
def update_zoom_effect(i,index)
if i.zoom_x > 1.00
i.zoom_x -= 0.01
i.zoom_y -= 0.01
if i.zoom_x < 1.00
i.zoom_x = 1.00
i.zoom_y = 1.00
end
end
end
#
# ● Update Title Name
#
def update_title_name
return if @phase != 1
return if @title_name == nil
@title_name.opacity += 5
return if @title_name.opacity < 255
@phase = 2
end
#
# ● Update Magic Circle
#
def update_magic_circle
return if @magic_circle == nil
@magic_circle.angle += 1
end
#
# ● Update Particles
#
def update_particles
return if @particles_bitmap == nil
@particles_bitmap.each {|sprite| sprite.update }
end
#
# ● Update Command
#
def update_command
return if @commands == nil
update_skip_all
index = 0
return if @phase != 2
update_key
@magic_circle.opacity += 5
for i in @commands
if @command_index == index
update_command_select1(i,index)
else
update_command_select2(i,index)
end
index += 1
end
end
#
# ● Update Key
#
def update_key
return if @skip_wait > 0
update_select_command
return if @command_wait
if Input.press?(:RIGHT) or Input.press?(:DOWN)
add_index(1)
elsif Input.press?(:LEFT) or Input.press?(:UP)
add_index(-1)
end
end
#
# ● Add Index
#
def add_index(value)
Sound.play_cursor
index = @command_index
index += value
index = 0 if index > 2
index = 2 if index < 0
@command_index = index
end
#
# ● Update Select Command
#
def update_select_command
if Input.trigger?(:C)
case @command_index
when 0
Sound.play_ok
command_new_game
when 1
if DataManager.save_file_exists?
command_continue
else
Sound.play_buzzer
end
when 2
Sound.play_ok
command_shutdown
end
end
end
#
# ● Update Command Select 1
#
def update_command_select1(i,index)
return if i.opacity == 255 and i.zoom_x == 1.00
i.opacity += 7
if i.zoom_x > 1.00
i.zoom_x -= 0.01
i.zoom_y -= 0.01
@command_wait = true
if i.zoom_x <= 1.00
i.opacity = 255
@command_wait = false
end
end
end
#
# ● Update Command Select 2
#
def update_command_select2(i,index)
return if i.opacity == 0
i.opacity -= 7
if i.zoom_x < 1.50
i.zoom_x += 0.01
i.zoom_y += 0.01
i.opacity = 0 if i.zoom_x >= 1.50
end
end
#
# ● Command New Game
#
def command_new_game
DataManager.setup_new_game
fadeout_all
$game_map.autoplay
SceneManager.goto(Scene_Map)
end
#
# ● Command Continue
#
def command_continue
Sound.play_ok
SceneManager.call(Scene_Load)
end
#
# ● Commad Shutdown
#
def command_shutdown
fadeout_all
SceneManager.exit
end
#
# ● Skip All
#
def update_skip_all
@skip_wait -= 1 if @skip_wait > 0
return if @phase > 1
if Input.trigger?(:C) or Input.trigger?(:
reset_main_sprites
skip_sprite_effects
clear_main_sprites
end
end
#
# ● Skip Sprites Effects
#
def skip_sprite_effects
loop do
@title_name.opacity += 10
for i in @magic_girls
i.opacity += 10
if i.zoom_x > 1.00
i.zoom_x -= 0.01
i.zoom_y -= 0.01
end
end
break if @title_name.opacity >= 255
Graphics.update
end
end
#
# ● Reset Main Sprites
#
def reset_main_sprites
@title_name.opacity= 0
for i in @magic_girls
i.zoom_x = 1.00
i.zoom_y = 1.00
end
end
#
# ● Clear All Sprites
#
def clear_main_sprites
@title_name.opacity= 255
for i in @magic_girls
i.opacity = 255
i.zoom_x = 1.00
i.zoom_y = 1.00
end
@magic_girl_index = @magic_girls.size + 1
@phase = 2
clear_command_sprites
@skip_wait = 10
@command_wait = false
end
#
# ● Clear Command Sprites
#
def clear_command_sprites
index = 0
for i in @commands
if @command_index == index
i.zoom_x = 1.50
i.zoom_y = 1.50
i.opacity = 0
else
i.zoom_x = 1.50
i.zoom_y = 1.50
i.opacity = 0
end
index += 1
end
end
end
$mog_rgss3_madoka_title_screen = true
Демо yadi.sk/d/GLU8JYKgcGXxC
Исходники MOG - Animated Title A (v2.3):
# +++ MOG - Animated Title A (v2.3) +++
#==============================================================================
# By Moghunter
# www.atelier-rgss.com/
#==============================================================================
# Tela de titulo animado, com logo, imagens aleatórias e outros efeitos visuais.
#==============================================================================
#==============================================================================
# IMAGENS NECESSÁRIAS
#==============================================================================
# Serão necessários as seguintes imagens na pasta Graphics/Titles2/
#
# Cursor.png
# Commmand_Name.png (image filename = name of command)
# Particle.png (Opcional)
# Logo.jpg (Opcional)
# Animated.png (Opcional)
#==============================================================================
#==============================================================================
# NOTA 1 - Para definir a imagem de texto basta selecionar no banco de dados
# a imagem do titulo numero 2 (Segunda camada)
#==============================================================================
#==============================================================================
# NOTA 2 - O nome da imagem de comando é iguál ao nome do comando definido
# no banco de dados do Rpg Maker.
#==============================================================================
#==============================================================================
# ● Histórico (Version History)
#==============================================================================
# v 2.3 - O nome do comando não é mais baseado no database.
#==============================================================================
module MOG_SCENE_TITLE_A
#
# ▼ LOGO ▼
#
# Apresenta um Logo ao começar a tela de titulo.
# Será necessário ter a imagem LOGO.jpg (png) na pasta Graphics/Title2
#
# Ativar Logo
LOGO = true
# Duração do logo.
LOGO_DURATION = 2 #(Sec)
#
# ▼ RANDOM BACKGROUND ▼
#
#Definição das pictures.
#
RANDOM_PICTURES = [
"Title0", "Title1", "Title2", "Title3"
#"Title4","Title5","Title6","Title7"
]
#Tempo de duração para ativar a troca de imagens.
RANDOM_PICTURES_DURATION = 10#(sec)
#Seleção aleatória.
RAMDOM_SELECTION = true
#Velocidade de Scrolling. (Speed X , Speed Y)
RANDOM_PICTURES_SCROLL_SPEED = [0,0]
#
# ▼ MULTIPLE LAYERS ▼
#
# Definição de multiplas camadas. * (não há limíte na quantidade de camadas
# usadas)
#
# MULTIPLE_LAYERS = [ ["A",B,C,D], ["A",B,C,D], ["A",B,C D], ["A",B,C,D ], ....]
#
# A - Nome da imagem.
# B - Velocidade de scroll na horizontal.
# C - Velocidade de scroll na vertical.
# D - Tipo de Blend. (0 - Normal / 2 - Add / 3 - Substract)
#
MULTIPLE_LAYERS = [
["Layer1",1,0,1],
["Layer2",3,0,1],
["Layer3",0,0,0]
# ["Layer4",0,0,0],
# ["Layer5",0,0,0],
# ["Layer6",0,0,0]
]
#
# ▼ PARTICLES ▼
#
# Adiciona partículas animadas na tela do titulo.
# Será necessário ter a imagem PARTICLE.png na pasta Graphics/Title2
#
# Ativar Partículas.
PARTICLE = true
# Ativar Cores Aleatórias.
PARTICLE_RANDOM_COLOR = true
# Definição do tipo de blend. (0,1,2)
PARTICLE_BLEND_TYPE = 1
#Definição do limite de velocidade das partículas.
PARTICLE_MOVEMENT_RANGE_X = 3
PARTICLE_MOVEMENT_RANGE_Y = 3
PARTICLE_ANGLE_RANGE = 3
#
# ▼ WAVE TITLE ▼
#
# Ativa o efeito WAVE no texto do titulo, o Texto do titulo é definido
# na camada do titulo 2, que pode ser definido através do banco de dados
#
#Ativar o efeito do titulo com efeito WAVE.
TITLE_WAVE = true
#Configuração do efeito WAVE
#
# TITLE_WAVE_CONFIG = [ AMP, LENGTH , SPEED]
#
TITLE_WAVE_CONFIG = [6 , 232 , 360]
#
# ▼ ANIMATED_SPRITE ▼ (Opcional)
#
# Adiciona um sprite animado no titulo.
# A quantidade de frames é proporcional a largura dividido pela altura
# da imagem, ou seja, não há limite de quantidade de frames e nem de
# tamanho da imagem.
# Será necessário ter a imagem ANIMATED.png (Jpg) na pasta Graphics/Title2
#
# Ativar Sprite animado.
ANIMATED_SPRITE = true
# Posição do Sprite animado.
ANIMATED_SPRITE_POSITION = [130,150]
# Velocidade da animação
ANIMATED_SPRITE_SPEED = 10
# Tipo de Blend. (0 - Normal / 2 - Add / 3 - Substract)
ANIMATED_SPRITE_BLEND_TYPE = 1
# Definição do zoom,
ANIMATED_SPRITE_ZOOM = 1.5
#
# ▼ COMMANDS / SELECTION ▼
#
# Configuração extras da tela de titulo.
#
# Posição do comando.
COMMANDS_POS = [220 , 280]
# Ativar o efeito de tremor ao selecionar o comando.
COMMAND_SHAKE = true
# Definição da posição do cursor.(Para ajustes)
CURSOR_POS = [-42,-7]
# Ativar flash ao mover o comando.
CURSOR_FLASH_SELECTION = true
# Definição da posição do flash.
CURSOR_FLASH_SLECTION_POS = [-180,0]
# Tipo de Blend. (0 - Normal / 2 - Add / 3 - Substract)
CURSOR_FLASH_SLECTION_BLEND_TYPE = 1
end
#==============================================================================
# ■ Window TitleCommand
#==============================================================================
class Window_TitleCommand < Window_Command
attr_reader :list
end
#==============================================================================
# ■ Particle Title
#==============================================================================
class Particle_Title < Sprite
include MOG_SCENE_TITLE_A
#
# ● Initialize
#
def initialize(viewport = nil)
super(viewport)
self.bitmap = Cache.title2("Particle")
self.tone.set(rand(255),rand(255), rand(255), 255) if PARTICLE_RANDOM_COLOR
self.blend_type = PARTICLE_BLEND_TYPE
@cw = self.bitmap.width
@ch = self.bitmap.height
@nx = PARTICLE_MOVEMENT_RANGE_X
@ny = PARTICLE_MOVEMENT_RANGE_Y
reset_setting
end
#
# ● Reset Setting
#
def reset_setting
zoom = (50 + rand(100)) / 100.1
self.zoom_x = zoom
self.zoom_y = zoom
self.x = (rand(576) -32)
self.y = rand(448 + @ch)
self.opacity = 0
self.angle = rand(360)
nx2 = rand(@nx).abs
nx2 = 1 if (@nx != 0 and nx2 < 1)
@speed_x = @nx > 0 ? nx2 : @nx < 0 ? -nx2 : 0
ny2 = rand(@ny).abs
ny2 = 1 if (@ny != 0 and ny2 < 1)
@speed_y = @ny > 0 ? ny2 : @ny < 0 ? -ny2 : 0
@speed_a = [[rand(PARTICLE_ANGLE_RANGE), PARTICLE_ANGLE_RANGE].min, 0].max
end
#
# ● Dispose
#
def dispose
super
self.bitmap.dispose
end
#
# ● Update
#
def update
super
self.x += @speed_x
self.y -= @speed_y
self.angle += @speed_a
self.opacity += 5
reset_setting if can_reset_setting?
end
#
# ● Can Reset Setting
#
def can_reset_setting?
return true if (self.x < -48 or self.x > 592)
return true if (self.y < -48 or self.y > 464)
return false
end
end
#==============================================================================
# ■ Multiple Layers Title
#==============================================================================
class Multiple_Layers_Title
#
# ● Initialize
#
def initialize(name = "", scroll_x = 0, scroll_y = 0, blend = 0, index = 0)
@layer = Plane.new
@layer.bitmap = Cache.title1(name.to_s) rescue nil
@layer.bitmap = Bitmap.new(32,32) if @layer.bitmap == nil
@layer.z = 10 + index
@layer.opacity = 0
@layer.blend_type = blend
@scroll_speed = [scroll_x, scroll_y]
end
#
# ● Dispose
#
def dispose
@layer.bitmap.dispose
@layer.bitmap = nil
@layer.dispose
end
#
# ● Update
#
def update
@layer.opacity += 2
@layer.ox += @scroll_speed[0]
@layer.oy += @scroll_speed[1]
end
end
#==============================================================================
# ■ Scene Title
#==============================================================================
class Scene_Title < Scene_Base
include MOG_SCENE_TITLE_A
#
# ● Start
#
def start
super
RPG::BGM.fade(2000)
@logo_active = LOGO
SceneManager.clear
@phase = 1
@phase_time = -1
dispose_title_sprites
create_logo if @logo_active
create_command_window
create_commands
create_background
create_light
create_cursor
create_animated_object
create_flash_select
create_multiple_layers
play_title_music unless @logo_active
end
#
# ● Create Multiple Layers
#
def create_flash_select
return if !CURSOR_FLASH_SELECTION
@flash_select = Sprite.new
@flash_select.bitmap = Cache.title2("Cursor2")
@flash_select.z = 99
@flash_select.opacity = 0
@flash_select.blend_type = CURSOR_FLASH_SLECTION_BLEND_TYPE
end
#
# ● Create Multiple Layers
#
def create_multiple_layers
@m_layers = []
index = 0
for i in MULTIPLE_LAYERS
@m_layers.push(Multiple_Layers_Title.new(i[0],i[1],i[2],i[3],index))
index += 1
end
end
#
# ● Create_Logo
#
def create_animated_object
return if !ANIMATED_SPRITE
@object_index = 0
@object_animation_speed = 0
@object = Sprite.new
@object.z = 98
@object.opacity = 0
@object.blend_type = ANIMATED_SPRITE_BLEND_TYPE
@object.zoom_x = ANIMATED_SPRITE_ZOOM
@object.zoom_y = ANIMATED_SPRITE_ZOOM
@object_image = Cache.title2("Animated")
@object_frame_max = @object_image.width / @object_image.height
@object_width = @object_image.width / @object_frame_max
@object.bitmap = Bitmap.new(@object_width,@object_image.height)
@object.x = ANIMATED_SPRITE_POSITION[0]
@object.y = ANIMATED_SPRITE_POSITION[1]
make_object_bitmap
end
#
# ● Create_Logo
#
def create_cursor
@cursor = Sprite.new
@cursor.bitmap = Cache.title2("Cursor")
@cursor.opacity = 0
@cursor.z = 130
@cursor_position = [0,0]
@mx = [0,0,0]
end
#
# ● Create_Logo
#
def create_logo
@phase = 0
@logo = Sprite.new
@logo.bitmap = Cache.title2("Logo")
@logo.opacity = 0
@logo_duration = 180 + (LOGO_DURATION * 60)
@logo.z = 200
end
#
# ● Create Commands
#
def create_commands
@command_window.visible = false
@commands_index_old = -1
@commands = []
@commands_shake_duration = 0
index = 0
for com in 0...3
sprite = Sprite.new
case index
when 0; com_name = "New_Game"
when 1; com_name = "Continue"
when 2; com_name = "Shutdown"
end
sprite.bitmap = Cache.title2(com_name.to_s) rescue nil
if sprite.bitmap == nil
sprite.bitmap = Bitmap.new(200,32)
sprite.bitmap.font.size = 24
sprite.bitmap.font.bold = true
sprite.bitmap.font.italic = true
sprite.bitmap.draw_text(0, 0, 200, 32, com_name.to_s,1)
end
sprite.x = COMMANDS_POS[0] - 100 - (index * 20)
sprite.y = index * sprite.bitmap.height + COMMANDS_POS[1]
sprite.z = 100 + index
sprite.opacity = 0
index += 1
@commands.push(sprite)
end
@command_max = index
end
#
# ● create_background
#
def create_background
@rand_title_duration = 120
@old_back_index = 0
@sprite1 = Plane.new
@sprite1.opacity = 0
@sprite1.z = 1
if RAMDOM_SELECTION
execute_random_picture(false)
else
execute_random_picture(true)
end
@sprite2 = Sprite.new
@sprite2.bitmap = Cache.title2($data_system.title2_name)
@sprite2.z = 140
@sprite2.opacity = 0
if TITLE_WAVE
@sprite2.wave_amp = TITLE_WAVE_CONFIG[0]
@sprite2.wave_length = TITLE_WAVE_CONFIG[1]
@sprite2.wave_speed = TITLE_WAVE_CONFIG[2]
end
end
#
# ● Create Light
#
def create_light
return unless PARTICLE
@viewport_light = Viewport.new(-32, -32, 600, 480)
@viewport_light.z = 50
@light_bitmap =[]
for i in 0...20
@light_bitmap.push(Particle_Title.new(@viewport_light))
end
end
#
# ● dispose Background1
#
def dispose_background1
@sprite1.bitmap.dispose
@sprite1.bitmap = nil
@sprite1.dispose
@sprite1 = nil
end
#
# ● Dispose Background2
#
def dispose_background2
if @sprite2.bitmap != nil
@sprite2.bitmap.dispose
@sprite2.bitmap = nil
@sprite2.dispose
@sprite2 = nil
end
end
#
# ● Dispose Light
#
def dispose_light
return unless PARTICLE
if @light_bitmap != nil
for i in @light_bitmap
i.dispose
end
@light_bitmap = nil
end
@viewport_light.dispose
end
#
# ● Dispose Logo
#
def dispose_logo
return unless @logo_active
@logo.bitmap.dispose
@logo.dispose
end
#
# ● Dispose Multiple Layers
#
def dispose_multiple_layers
return if @m_layers == nil
@m_layers.each {|layer| layer.dispose }
end
#
# ● Terminate
#
def terminate
super
dispose_title_sprites
end
#
# ● Dispose Title Sprites
#
def dispose_title_sprites
return if @cursor == nil
dispose_background1
dispose_background2
dispose_light
dispose_logo
dispose_multiple_layers
@cursor.bitmap.dispose
@cursor.dispose
@cursor = nil
if @flash_select != nil
@flash_select.bitmap.dispose
@flash_select.dispose
end
for com in @commands
com.bitmap.dispose
com.dispose
end
if ANIMATED_SPRITE
@object.bitmap.dispose
@object.dispose
@object_image.dispose
end
end
#
# ● Update
#
def update
super
update_logo
update_initial_animation
update_command
update_background
update_light
update_object_animation
update_multiple_layers
end
#
# ● Update Multiple Layers
#
def update_multiple_layers
return if @m_layers == nil
@m_layers.each {|layer| layer.update }
end
#
# ● Make Object bitmap
#
def make_object_bitmap
@object.bitmap.clear
src_rect_back = Rect.new(@object_width * @object_index, 0,@object_width,@object_image.height)
@object.bitmap.blt(0,0, @object_image, src_rect_back)
end
#
# ● Update Object Animation
#
def update_object_animation
return if !ANIMATED_SPRITE
@object.opacity += 2
@object_animation_speed += 1
if @object_animation_speed > ANIMATED_SPRITE_SPEED
@object_animation_speed = 0
@object_index += 1
@object_index = 0 if @object_index >= @object_frame_max
make_object_bitmap
end
end
#
# ● Update Cursor Position
#
def update_cursor_position
@cursor.opacity += 5
execute_animation_s
execute_cursor_move(0,@cursor.x,@cursor_position[0] + @mx[1])
execute_cursor_move(1,@cursor.y,@cursor_position[1])
end
#
# ● Execute Animation S
#
def execute_animation_s
@mx[2] += 1
return if @mx[2] < 4
@mx[2] = 0
@mx[0] += 1
case @mx[0]
when 1..7; @mx[1] += 1
when 8..14; @mx[1] -= 1
else
@mx[0] = 0
@mx[1] = 0
end
end
#
# ● Execute Cursor Move
#
def execute_cursor_move(type,cp,np)
sp = 5 + ((cp - np).abs / 5)
if cp > np
cp -= sp
cp = np if cp < np
elsif cp < np
cp += sp
cp = np if cp > np
end
@cursor.x = cp if type == 0
@cursor.y = cp if type == 1
end
#
# ● Update Logo
#
def update_logo
return if @phase != 0
loop do
break if @logo_duration == 0
execute_logo
Graphics.update
Input.update
end
play_title_music
end
#
# ● Execute Logo
#
def execute_logo
if @logo_duration > 120 and (Input.trigger?(:C) or Input.trigger?(:
@logo_duration = 120
end
@logo_duration -= 1
if @logo_duration > 120
@logo.opacity += 5
else
@logo.opacity -= 5
end
if @logo.opacity <= 0
@logo_duration = 0
@phase = 1
end
end
#
# ● Update Background
#
def update_background
@sprite1.ox += RANDOM_PICTURES_SCROLL_SPEED[0]
@sprite1.oy += RANDOM_PICTURES_SCROLL_SPEED[1]
@sprite2.opacity += 2
@sprite2.update
return if RANDOM_PICTURES.size < 1
@rand_title_duration -= 1
if @rand_title_duration <= 0
@sprite1.opacity -= 5 unless RANDOM_PICTURES.size < 2
else
@sprite1.opacity += 5
end
return if @sprite1.opacity != 0
execute_random_picture
end
#
# ● Execute Random Picture
#
def execute_random_picture(initial = false)
@rand_title_duration = [[60 * RANDOM_PICTURES_DURATION, 9999].min, 60].max
if @sprite1.bitmap != nil
@sprite1.bitmap.dispose
@sprite1.bitmap = nil
end
if RAMDOM_SELECTION
rand_pic = rand(RANDOM_PICTURES.size)
if rand_pic == @old_back_index
rand_pic += 1
rand_pic = 0 if rand_pic >= RANDOM_PICTURES.size
end
@old_back_index = rand_pic
else
@old_back_index += 1 unless initial
@old_back_index = 0 if @old_back_index >= RANDOM_PICTURES.size
end
pic = RANDOM_PICTURES[@old_back_index]
@sprite1.bitmap = Cache.title1(pic) rescue nil
@sprite1.bitmap = Cache.title1("") if @sprite1.bitmap == nil
end
#
# ● Update Light
#
def update_light
return unless PARTICLE
if @light_bitmap != nil
for i in @light_bitmap
i.update
end
end
end
#
# ● Update Initial Animation
#
def update_initial_animation
return if @phase != 1
@phase_time -= 1 if @phase_time > 0
if @phase_time == 0
@phase = 2
@phase_time = 30
end
for i in @commands
index = 0
if i.x < COMMANDS_POS[0]
i.x += 5 + (2 * index)
i.opacity += 10
if i.x >= COMMANDS_POS[0]
i.x = COMMANDS_POS[0]
i.opacity = 255
if @phase_time < 15 / 2
@phase_time = 15
end
end
end
index += 1
end
end
#
# ● Update Command
#
def update_command
return if @phase != 2
update_command_slide
update_cursor_position
update_flash_select
end
#
# ● Update Command Slide
#
def update_command_slide
if @commands_index_old != @command_window.index
@commands_index_old = @command_window.index
@commands_shake_duration = 30
if @flash_select != nil
@flash_select.opacity = 255
end
end
return if @commands_shake_duration == 0
@commands_shake_duration -= 1 if @commands_shake_duration > 0
@commands_shake_duration = 0 if !COMMAND_SHAKE
for i in @commands
if (i.z - 100) == @command_window.index
i.opacity += 10
@cursor_position = [COMMANDS_POS[0] + CURSOR_POS[0],i.y + CURSOR_POS[1]]
i.x = COMMANDS_POS[0] + rand(@commands_shake_duration)
else
i.opacity -= 7 if i.opacity > 100
i.x = COMMANDS_POS[0]
end
end
end
#
# ● Update Flash Select
#
def update_flash_select
return if !CURSOR_FLASH_SELECTION
@flash_select.opacity -= 8
@flash_select.x = @cursor_position[0] + CURSOR_FLASH_SLECTION_POS[0]
@flash_select.y = @cursor_position[1] + CURSOR_FLASH_SLECTION_POS[1]
end
end
$mog_rgss3_animated_title_a = true
Демо yadi.sk/d/cHR7S6KPcGXxr
А вот что пока получилось у меня со всем этим.. Демо yadi.sk/d/aYp_4zAFcGXxY
Очень жду вашей помощи
Пожалуйста Войти или Регистрация, чтобы присоединиться к беседе.
Там же находим строку random selection = true и тоже меняем значение на false. Отключается случайный выбор титульника.
И в квадратных скобках убираем все прописанные там титульники, кроме своего.
Находим там же строку particle = true и делаем то же самое, что и в первом случае.
А убирать курсоры, скорее всего, придется в фотошопе.
Всего хорошего, и спасибо за рыбу
Пожалуйста Войти или Регистрация, чтобы присоединиться к беседе.
Sypherot пишет: Во втором скрипте находим строку title wave = true и меняем значение на false. Это уберет "волну".
Там же находим строку random selection = true и тоже меняем значение на false. Отключается случайный выбор титульника.
И в квадратных скобках убираем все прописанные там титульники, кроме своего.
Находим там же строку particle = true и делаем то же самое, что и в первом случае.
А убирать курсоры, скорее всего, придется в фотошопе.
Все что ты написал я уже и так сделал.. поменял где нужно значение с тру на фалс, а где нельзя сделал текстуры полностью прозрачные..
Однако это не решение проблемы..
Нужно во первых обьеденить 2 скрипта а во вторых вырезать не нужные функции, а не просто выставить им значение "не используется"
Я пытался вырезать, но то там.. то тут ругается копмилятор на синтаксис или недостающие команды
Пожалуйста Войти или Регистрация, чтобы присоединиться к беседе.
Жуть болотная, на лапках, в тапках и с пулемётом...
Пожалуйста Войти или Регистрация, чтобы присоединиться к беседе.
ну а зачем собирать информационный мусор если я им не пользуюсь?))Cerberus пишет: А зачем вырезать-то, если в самой игре они никак не проявляются?
Лишние байты информации..
Ладно, с вырезанием проехали..
Главный вопрос темы - объединение скриптов, я уже писал выше, что мне нужна функция меню по 1 команде как в 1 скрипте и все остальное из 2 скрипта, а тут без копи-паста и дописывания скрипта своими силами не обойтись, именно в этом вопросе я и прошу помощи..
+ хотелось бы добавить возможность:
* Добавить функцию, либо пишется текст, либо рисуется картинка внизу экрана, в зависимости от выбранной команды. Например, для команды Новая игра будет написано: Начинает историю заново новым персонажем.
Для продолжить - Загружает и продолжает выбранную историю, и для выйти - что-то третье)
Что также я не знаю как реализовать, тк в скриптинге руби 0 целых 1 десятая
Пожалуйста Войти или Регистрация, чтобы присоединиться к беседе.
