Save-Point
introtexte in menu title, - Printable Version

+- Save-Point (https://www.save-point.org)
+-- Forum: Archives (https://www.save-point.org/forum-105.html)
+--- Forum: Creation Asylum Archives (https://www.save-point.org/forum-90.html)
+---- Forum: Scripts & Code Snippets (https://www.save-point.org/forum-92.html)
+----- Forum: RPG Maker XP Code (https://www.save-point.org/forum-93.html)
+----- Thread: introtexte in menu title, (/thread-6825.html)



introtexte in menu title, - Berith - 12-28-2005

This is a locked, single-post thread from Creation Asylum. Archived here to prevent its loss.
No support is given. If you are the owner of the thread, please contact administration.


i've done this for my game so to make an intro separate from the game.
don't forget to change the text


self.contents.font.size = 20
self.contents.draw_text(0, 0, 640, 20,"Dans chaque histoire il y a un héro et dans chaque")

so if you change the size of the text change only this.

like

self.contents.font.size = 40
self.contents.draw_text(0, 0, 640, 40,"Dans chaque histoire il y a un héro et dans chaque")

but you need for the next line to change one coordinate

self.contents.draw_text(0, 40, 640, 40,"fragile a la fois")
self.contents.draw_text(0, 80, 640, 40,"fragile a la fois")

it's just add 40 on each line.

adding a new Window_histoire

Code:
# adding class histoire
# create by Berith
# 27/12/2005
# this can be use as template

class Window_Histoire < Window_Base

#---------------------------
#initialize
#----------------------------

def initialize
super (0,0,640,480)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = "Arial"
self.contents.font.size = 20
self.opacity = 0

#optional setting for image background put own background
@Background = Sprite.new
@Background.bitmap = RPG::Cache.picture("")
@Background.opacity = 255

self.active = false
refresh
end

#------------------------------------
# drawtext
#-----------------------------------

def refresh
self.contents.clear
self.contents.font.color = normal_color

# first dialogue
self.contents.draw_text(0, 0, 640, 20,"Dans chaque histoire il y a un héro et dans chaque")
self.contents.draw_text(0, 20, 640, 20,"héro se cache une personne souvent fort mais aussi")
self.contents.draw_text(0, 40, 640, 20,"fragile a la fois")

# second dialogue
self.contents.draw_text(0, 80, 640, 20,"Ici notre histoire se passe 4 ans avant, il ni a pas")
self.contents.draw_text(0, 100, 640, 20,"de guerre ou autre combat entre le bien et mal")
self.contents.draw_text(0, 120, 640, 20,"non c'est quelque chose d'autre")

# third dialogue
self.contents.draw_text(0, 160, 640, 20,"Si l'on vos raconte de belles histoires avec le ")
self.contents.draw_text(0, 180, 640, 20,"preux chevalier et la belle princesse, et bien la se n'est ")
self.contents.draw_text(0, 200, 640, 20,"pas le cas,si vos aimer pas les fantômes parter vite")

#end dialogue
end

#------------------------------------
# bloque
#-----------------------------------
end

after we add the Scene_Histoire

Code:
# adding class histoire
# create by Berith
# 27/12/2005
# this can be use as template

class Scene_Histoire

#---------------------------
#initialize
#----------------------------

def main

@Histoire_window = Window_Histoire.new
#----------------------------------------------------------
Graphics.transition
loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end
Graphics.freeze
@Histoire_window.dispose
if $scene.is_a?(Scene_Histoire)
Graphics.transition
Graphics.freeze
end
end

#------------------------------------
# def update window
#-----------------------------------
def update
@Histoire_window.update

if @Histoire_window.active
update_command
return
end

if Input.trigger?(Input::C)
$scene = Scene_Title.new
end
end
#------------------------------------
# def command
#-----------------------------------

end

just one more thing to do add custome command form the Scene_Title

Code:
s1 = "Nouvelle partie"
s2 = "Charger une partie"
s3= "Histoire"
s4 = "Quitter"
@command_window = Window_Command.new(220, [s1, s2, s3,s4])

just a few line below

Code:
def update

@command_window.update

if Input.trigger?(Input::C)

case @command_window.index
when 0
command_new_game
when 1
command_continue
when 2 #custom command
command_Histoire
when 3
command_shutdown
end
end
end

now add this just under the command_continue

Code:
#--------------------------------------------------------------------------
# ● Histoire
#--------------------------------------------------------------------------
def command_Histoire
$game_system.se_play($data_system.decision_se)
# BGM を停止
Audio.bgm_stop
# プレイ時間計測用のフレームカウントをリセット
Graphics.frame_count = 0
# 各種ゲームオブジェクトを作成
$game_temp = Game_Temp.new
$game_system = Game_System.new
$game_switches = Game_Switches.new
$game_variables = Game_Variables.new
$game_self_switches = Game_SelfSwitches.new
$game_screen = Game_Screen.new
$game_actors = Game_Actors.new
$game_party = Game_Party.new
$game_troop = Game_Troop.new
$game_map = Game_Map.new
$game_player = Game_Player.new
# 初期パーティをセットアップ
$game_party.setup_starting_members
# 初期位置のマップをセットアップ
$game_map.setup($data_system.start_map_id)
$game_player.moveto($data_system.start_x, $data_system.start_y)
# プレイヤーをリフレッシュ
$game_player.refresh
$game_map.autoplay
$game_map.update
$scene = Scene_Histoire.new
end

now it's finish