site consacré a vos création.
 
AccueilFAQRechercherS'enregistrerMembresGroupesConnexion

Partagez | 
 

 barre de chargement au debut du jeux

Aller en bas 
AuteurMessage
nara bakura
Prophete
Prophete
avatar

Nombre de messages : 55
Date d'inscription : 24/06/2007

Fueille de participation
Niveau: 3
points d'Exp:
55/200  (55/200)

MessageSujet: barre de chargement au debut du jeux   Mar 3 Juil - 18:30

Auteur: Illusion
Ce script mets des barres de chargement au debut du jeu

Creer un nouveau scripts au dessus de main et nommer le "bitmap"

code:
Code:
# A gradient bar... no need to explain :P
# Made By Illusion
class Bitmap
def gradient_fill_rect(x, y, width = nil, height = nil, color = nil)
if x.is_a?(Rect)
color = y
height = x.height
end
origin_aplha = color.alpha
temp_color_alpha = 0
for i in 0...height
temp_color_alpha += origin_aplha / height.to_f
temp_color = Color.new(color.red, color.green, color.blue, temp_color_alpha)
if x.is_a?(Rect)
self.fill_rect(x, temp_color)
else
self.fill_rect(x, y + i, width, height - i, temp_color)
end
end
end
end
Creer un nouveau script au dessus de main et nommez le "Window_Base"
code:

Code:
# ■ Window_Base
#------------------------------------------------------------------------------
# Some modifications to make some special effects.
# By : Illusion
# Descriptions :
# self.shake = true >> Will shake the window and its contents.
# self.bounce(x or y or both) >> Will "bounce" the window up, donw, left and right.
# self.continuous_transparency = true >> Will make the window fade in and out.
# Before setting one these settings in your scene do this :
# @window_thing.x = desired x
# @window_thing.y = desired y
# @window_thing.update
# @window_thing.effect_attribute = true or false
#==============================================================================

class Window_Base
attr_accessor :shake
attr_accessor :bounce_x
attr_accessor :bounce_y
attr_accessor :continuous_transparency
alias effects_initialize initialize
alias effects_update update
def initialize(x, y, width, height)
@old_x = x
@old_y = y
effects_initialize(x, y, width, height)
self.shake = false
self.bounce_x = false
self.bounce_y = false
self.continuous_transparency = false
end
def update
@old_x = self.x unless move_effects
@old_y = self.y unless move_effects
effects_update
# If the window has a shake status, shake it.
if self.shake
self.x = @old_x + rand(5)
self.y = @old_y - rand(5)
end
# If the window has a bouncing status, move it.
if self.bounce_y
@down = true if self.y < @old_y - 40
@down = false if self.y > @old_y+ 10
self.y += 1 if @down
self.y -= 1 unless @down
end
if self.bounce_x
@left = true if self.x < @old_x - 20
@left = false if self.x > @old_x + 30
self.x += 1 if @left
self.x -= 1 unless @left
end
# If the window has a transparency status, change its transparency it.
if self.continuous_transparency
@opacity_up = true if self.opacity <= 10
@opacity_up = false if self.opacity >= 255
self.opacity += 2 if @opacity_up
self.opacity -= 2 unless @opacity_up
end
end
#-------------------------------------------------------------
# ● Enables bouncing effect
#-------------------------------------------------------------
def bounce
self.bounce_x = self.bounce_y = true
end
#-------------------------------------------------------------
# ● Checks that no window effect is active.
#-------------------------------------------------------------
def move_effects
a = false
a = true if self.bounce_x
a = true if self.bounce_y
a = true if self.shake
return a
end
end

Creer un nouveau script au dessus de main et nommez le "Window_Load_Data"
code:
Code:
#==============================================================================
# ■ Window_Load_Data
#------------------------------------------------------------------------------
# Shows the loading data bar and percentage.
# By : Illusion
#==============================================================================

class Window_Load_Data < Window_Base
attr_accessor :text
attr_accessor :color
#--------------------------------------------------------------------------
# ● Initializes the window.
#--------------------------------------------------------------------------
def initialize
super(190, 206, 250 + 32, 30 + 32 - 15)
self.contents = Bitmap.new(250, 32 - 6)
self.contents.font.name = $defaultfonttype
self.contents.font.size = 16
self.contents.font.color = Color.new(255, 255, 255, 255)
@text = ""
@color = Color.new(0, 0, 0, 255)
self.visible = true
end
#--------------------------------------------------------------------------
# ● Updates the bar and the text.
#--------------------------------------------------------------------------
def set_text_and_bar(percentage)
percentage = percentage.floor.to_i
update
# Clears the contents.
self.contents.clear
self.contents.gradient_fill_rect(0, 0, (percentage / 100.0 * self.contents.width), self.contents.height, @color)
text = @text+percentage.to_s+'%'
self.contents.draw_text(8, -4, text.size * 32, 32, text, 0)
end
end

Creer un nouveau script au dessus de main et nommez le "Scene_Title"

Code:
#==============================================================================
# ■ Scene_Title
#------------------------------------------------------------------------------
# Custom load window added.
# By Illusion
#==============================================================================

class Scene_Title
#--------------------------------------------------------------------------
# ● Main
#--------------------------------------------------------------------------
def main
# Go to B_TEST if user is testing a batttle.
if $BTEST
battle_test
return
end
# Create a new game_system
$game_system = Game_System.new
# Create the Sprites and windows.
@sprite = Sprite.new
@sprite.bitmap = RPG::Cache.title(load_data("Data/System.rxdata").title_name)
# If data is already loaded, skip this part.
if $data_system == nil
Graphics.transition
@window = Window_Load_Data.new
@window.color = Color.new(rand(255), rand(255), rand(255), 255)
@window.width = 283
@window.height = 60
load_hero_data
@window.color.set(rand(255), rand(255), rand(255))
load_class_data
@window.color.set(rand(255), rand(255), rand(255))
load_skill_data
@window.color.set(rand(255), rand(255), rand(255))
load_item_data
@window.color.set(rand(255), rand(255), rand(255))
load_weapons_data
@window.color.set(rand(255), rand(255), rand(255))
load_armor_data
@window.color.set(rand(255), rand(255), rand(255))
load_ennemy_data
@window.color.set(rand(255), rand(255), rand(255))
load_troop_data
@window.color.set(rand(255), rand(255), rand(255))
load_states_data
@window.color.set(rand(255), rand(255), rand(255))
load_animations_data
@window.color.set(rand(255), rand(255), rand(255))
load_tilesets_data
@window.color.set(rand(255), rand(255), rand(255))
load_common_events_data
@window.color.set(rand(255), rand(255), rand(255))
load_system_data
Graphics.freeze
@window.dispose
end
# Define the commands.
s1 = "New Game"
s2 = "Continue"
s3 = "Exit"
@command_window = Window_Command.new(192, [s1, s2, s3])
@command_window.back_opacity = 160
@command_window.x = 320 - @command_window.width / 2
@command_window.y = 288
@command_window.update
# Makes the command window bounce, removed if not desired.
@command_window.bounce
# Checks if a save file exists.
@continue_enabled = false
for i in 0..3
if FileTest.exist?("Save#{i+1}.sav")
@continue_enabled = true
end
end
# Disable the command if no save file exists, otherwise, place cursor on the continue option.
if @continue_enabled
@command_window.index = 1
else
@command_window.disable_item(1)
end
# Play title BGM.
$game_system.bgm_play($data_system.title_bgm)
# Stop the ME and BGS.
Audio.me_stop
Audio.bgs_stop
# De-freeze the screen.
Graphics.transition
# メインループ
loop do
# Update the screen.
Graphics.update
# Update the keyboard input.
Input.update
# Update.
update
# If $scene is not a Scene_Title, break.
if $scene != self
break
end
end
# Freezes the screen.
Graphics.freeze
# Release all the bitmaps / erase them.
@command_window.dispose
@sprite.bitmap.dispose
@sprite.dispose
end
#--------------------------------------------------------------------------
# ● Load Hero data
#--------------------------------------------------------------------------
def load_hero_data
@window.text = 'Chargement personnages '
size = load_data("Data/Actors.rxdata").size
$data_actors = []
for i in 0...size + 1
$data_actors[i] = load_data("Data/Actors.rxdata")[i]
@window.set_text_and_bar((i / size.to_f * 100).to_i)
Graphics.update
Input.update
end
end
#--------------------------------------------------------------------------
# ● Load class data
#--------------------------------------------------------------------------
def load_class_data
@window.text ='Chargement classes '
size = load_data("Data/Classes.rxdata").size
$data_classes = []
for i in 0...size + 1
$data_classes[i] = load_data("Data/Classes.rxdata")[i]
@window.set_text_and_bar((i / size.to_f * 100).to_i)
Graphics.update
Input.update
end
end
#--------------------------------------------------------------------------
# ● Load skill data
#--------------------------------------------------------------------------
def load_skill_data
@window.text = 'Chargement compétences '
size = load_data("Data/Skills.rxdata").size
$data_skills = []
for i in 0...size + 1
$data_skills[i] = load_data("Data/Skills.rxdata")[i]
@window.set_text_and_bar((i / size.to_f * 100).to_i)
Graphics.update
Input.update
end
end
#--------------------------------------------------------------------------
# ● Load item data
#--------------------------------------------------------------------------
def load_item_data
@window.text = 'Chargement Objets '
size = load_data("Data/Items.rxdata").size
$data_items = []
for i in 0...size + 1
$data_items[i] = load_data("Data/Items.rxdata")[i]
@window.set_text_and_bar((i / size.to_f * 100).to_i)
Graphics.update
Input.update
end
end
#--------------------------------------------------------------------------
# ● Load weapons data
#--------------------------------------------------------------------------
def load_weapons_data
size = load_data("Data/Weapons.rxdata").size
$data_weapons = []
@window.text = 'Chargement armes '
for i in 0...size + 1
$data_weapons[i] = load_data("Data/Weapons.rxdata")[i]
@window.set_text_and_bar((i / size.to_f * 100).to_i)
Graphics.update
Input.update
end
end
#--------------------------------------------------------------------------
# ● Load armor data
#--------------------------------------------------------------------------
def load_armor_data
size = load_data("Data/Armors.rxdata").size
$data_armors = []
@window.text = 'Chargement armures '
for i in 0...size + 1
$data_armors[i] = load_data("Data/Armors.rxdata")[i]
@window.set_text_and_bar((i / size.to_f * 100).to_i)
Graphics.update
Input.update
end
end
#--------------------------------------------------------------------------
# ● Load ennemy data
#--------------------------------------------------------------------------
def load_ennemy_data
size = load_data("Data/Enemies.rxdata").size
$data_enemies = []
@window.text = 'Chargement ennemies '
for i in 0...size + 1
$data_enemies[i] = load_data("Data/Enemies.rxdata")[i]
@window.set_text_and_bar((i / size.to_f * 100).to_i)
Graphics.update
Input.update
end
end
#--------------------------------------------------------------------------
# ● Load troop data
#--------------------------------------------------------------------------
def load_troop_data
size = load_data("Data/Troops.rxdata").size
$data_troops = []
@window.text = 'Chargement troops '
for i in 0...size + 1
$data_troops[i] = load_data("Data/Troops.rxdata")[i]
@window.set_text_and_bar((i / size.to_f * 100).to_i)
Graphics.update
Input.update
end
end
#--------------------------------------------------------------------------
# ● Load states data
#--------------------------------------------------------------------------
def load_states_data
size = load_data("Data/States.rxdata").size
$data_states = []
@window.text = 'Chargement états'
for i in 0...size + 1
$data_states[i] = load_data("Data/States.rxdata")[i]
@window.set_text_and_bar((i / size.to_f * 100).to_i)
Graphics.update
Input.update
end
end
#--------------------------------------------------------------------------
# ● Load animations data
#--------------------------------------------------------------------------
def load_animations_data
size = load_data("Data/Animations.rxdata").size
$data_animations = []
@window.text = 'Chargement animation '
for i in 0...size + 1
$data_animations[i] = load_data("Data/Animations.rxdata")[i]
@window.set_text_and_bar((i / size.to_f * 100).to_i)
Graphics.update
Input.update
end
end
#--------------------------------------------------------------------------
# ● Load tilesets data
#--------------------------------------------------------------------------
def load_tilesets_data
size = load_data("Data/Tilesets.rxdata").size
$data_tilesets = []
@window.text = 'Chargement décors '
for i in 0...size + 1
$data_tilesets[i] = load_data("Data/Tilesets.rxdata")[i]
@window.set_text_and_bar((i / size.to_f * 100).to_i)
Graphics.update
Input.update
end
end
#--------------------------------------------------------------------------
# ● Load common events data
#--------------------------------------------------------------------------
def load_common_events_data
size = load_data("Data/CommonEvents.rxdata").size
$data_common_events = []
@window.text = 'Chargement évènement commun '
for i in 0...size
$data_common_events[i] = load_data("Data/CommonEvents.rxdata")[i]
@window.set_text_and_bar((i / size.to_f * 100).to_i)
Graphics.update
Input.update
end
end
#--------------------------------------------------------------------------
# ● Load system data
#--------------------------------------------------------------------------
def load_system_data
system_attr_data = ['magic_number', 'party_members',
'elements', 'switches', 'variables', 'windowskin_name',
'title_name ', 'gameover_name' , 'battle_transition',
'title_bgm', 'battle_bgm ', 'battle_end_me ',
'gameover_me ', 'cursor_se', 'decision_se',
'cancel_se', 'buzzer_se', 'equip_se', 'shop_se ',
'save_se ', 'load_se', 'battle_start_se',
'escape_se', 'actor_collapse_se ', 'enemy_collapse_se',
'words', 'start_map_id', 'start_x', 'start_y',
'test_battlers', 'test_troop_id', 'battleback_name ',
'battler_name ', 'battler_hue', 'edit_map_id ']
size = system_attr_data.size
$data_system = RPG::System.new
@window.text = 'Chargement systeme '
for i in 0...size + 1
eval('$data_system.'+system_attr_data[i]+' = load_data("Data/System.rxdata").'+system_attr_data[i]) rescue nil
@window.set_text_and_bar((i / size.to_f * 100).to_i)
Graphics.update
Input.update
end
end
end
Revenir en haut Aller en bas
Voir le profil de l'utilisateur
 
barre de chargement au debut du jeux
Revenir en haut 
Page 1 sur 1
 Sujets similaires
-
» barre de chargement uniquement
» Barre de chargement
» Barre de chargement illimitée
» Bonne connexion mais téléchargement lent ( légal, les amis )
» Problème téléchargement office starter [résolu]

Permission de ce forum:Vous ne pouvez pas répondre aux sujets dans ce forum
la cité de mérélia :: La forge :: Script-
Sauter vers: