1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
| #-------------------------------------------------------------------------------
# Start Screen VX V.2.5
# (Created from Miget man12's More-than-usually Graphical Title)
# Last update : 2010/5/05
# Edited by Guyver's Bane
# And support given by Night5h4d3 for Battle Test problem.(resolved now)
# Credit goes to Miget man12 for the script this was made from.
# I take credit only in editing his original work.
#
#==============================================================================#
# This script allows you to have a Start screen upon playing #
#==============================================================================#
#------------------------------------------------------------------------------#
# Installation: Place above "Main". Basically it's pulg'n play. #
#------------------------------------------------------------------------------#
#==============================================================================#
# Customization #
#==============================================================================#
module GB
# The Number of COMMAND_ACTION, COMMAND_X and COMMAND_Y variables MUST be at
# least as much as the number of COMMAND_TEXT variables!! (You can have more
# than COMMAND_TEXT; it won't affect anything)
# The text drawn on the title screen
COMMAND_TEXT = [] # Leave alone!
COMMAND_TEXT[0] = "-Pressez Entrée-"
COMMAND_ACTION = [] # Leave alone!
COMMAND_ACTION[0] = "$scene = Scene_Title.new"
# ["Times New Roman", "Verdana", "Arial", "Courier New"]
# **the name MUST be in quotes!**
COMMAND_FONT = ["Bookman Old Style", "Verdana"]
# Size of Command Text
COMMAND_TEXT_SIZE = 28
COMMAND_SHADOW = false
COMMAND_BOLD = false
COMMAND_ITALIC = false
# Colors go like so:
# Color.new(red,green,blue[,transparency])
# Each color level ranges from 0 to 255
# All 255 is white
# All 0 is black
# Transparency can be left out! If it is, it will be automatically set to 255
# Color of Command Text when not selected
COMMAND_COLOR_NOT = Color.new(0,0,0)
# Color Command Text flashes when selected
COMMAND_COLOR_YES = Color.new(255,255,255)
COMMAND_X = [] # Leave alone!
COMMAND_Y = [] # Leave alone!
# X position of Start Text
COMMAND_X[0] = 200
# Y position of Start Text
COMMAND_Y[0] = 288
end
#==============================================================================#
# End Of Customization ^_^ #
#==============================================================================#
class Scene_PreTitle < Scene_Base
#--------------------------------------------------------------------------
# * Main Processing
#--------------------------------------------------------------------------
def main# If normal play
if $BTEST
$scene = Scene_Title.new
else
super # Usual main processing
end
end
#--------------------------------------------------------------------------
# * Start processing
#--------------------------------------------------------------------------
def start
super
@com_wait = 1
@sel_index = 0
create_title_graphics # Create title graphics
create_command_graphics # Create command graphics
play_title_music # Play title screen music
end
#--------------------------------------------------------------------------
# * Execute Transition
#--------------------------------------------------------------------------
def perform_transition
Graphics.transition(20)
end
#--------------------------------------------------------------------------
# * Post-Start Processing
#--------------------------------------------------------------------------
def post_start
super
end
#--------------------------------------------------------------------------
# * Pre-termination Processing
#--------------------------------------------------------------------------
def pre_terminate
super
end
#--------------------------------------------------------------------------
# * Termination Processing
#--------------------------------------------------------------------------
def terminate
super
dispose_command_graphics
dispose_title_graphics
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
super
update_com_graphics
if Input.trigger?(Input::DOWN)
pre_mvmt
if @sel_index == (GB::COMMAND_TEXT.size-1)
@sel_index = 0
else
@sel_index += 1
end
post_mvmt
elsif Input.trigger?(Input::UP)
pre_mvmt
if @sel_index == 0
@sel_index = (GB::COMMAND_TEXT.size-1)
else
@sel_index -= 1
end
post_mvmt
elsif Input.trigger?(Input::C)
eval(GB::COMMAND_ACTION[@sel_index])
end
end
#--------------------------------------------------------------------------
# * Update Command Graphics
#--------------------------------------------------------------------------
def update_com_graphics
@com_wait -= 1
if @com_wait <= 0
@com_graphics[@sel_index].flash(GB::COMMAND_COLOR_YES,120)
@com_wait = 120
end
for sprt in @com_graphics
sprt.update
end
end
#--------------------------------------------------------------------------
# * Post Selection Movement Processing
#--------------------------------------------------------------------------
def post_mvmt
@com_graphics[@sel_index].flash(GB::COMMAND_COLOR_YES,60)
@com_wait = 60
end
#--------------------------------------------------------------------------
# * Pre-Selection Movement Processing
#--------------------------------------------------------------------------
def pre_mvmt
@com_graphics[@sel_index].flash(GB::COMMAND_COLOR_NOT,60)
end
#--------------------------------------------------------------------------
# * Create Title Graphic
#--------------------------------------------------------------------------
def create_title_graphics
@sprite = Sprite.new
@sprite.bitmap = Cache.system("Title")
end
#-------------------------------------------------------------------------
# * Dispose of Title Graphic
#--------------------------------------------------------------------------
def dispose_title_graphics
@sprite.bitmap.dispose
@sprite.dispose
end
#--------------------------------------------------------------------------
# * Play Title Screen Music
#--------------------------------------------------------------------------
def play_title_music
Audio.bgm_play('AUDIO/BGM/Battle1', 80, 100)
RPG::BGS.stop
RPG::ME.stop
end
#--------------------------------------------------------------------------
# * Create Command Graphics
#--------------------------------------------------------------------------
def create_command_graphics#window
@command_window = Window_Base.new(250, 350, 44, 50)
@command_window.opacity = 0
@command_window.back_opacity = 0
@command_window.contents_opacity = 0
@command_window.openness = 0
@com_graphics = []
for index in 0..(GB::COMMAND_TEXT.size-1)
@com_graphics[index] = Sprite.new
@com_graphics[index].bitmap = Bitmap.new(200,200)
@com_graphics[index].bitmap.font.name = GB::COMMAND_FONT
@com_graphics[index].bitmap.font.size = GB::COMMAND_TEXT_SIZE
@com_graphics[index].bitmap.font.color = GB::COMMAND_COLOR_NOT
@com_graphics[index].bitmap.font.shadow = GB::COMMAND_SHADOW
@com_graphics[index].bitmap.font.bold = GB::COMMAND_BOLD
@com_graphics[index].bitmap.font.italic = GB::COMMAND_ITALIC
@com_graphics[index].ox = -(GB::COMMAND_X[index])
@com_graphics[index].oy = -(GB::COMMAND_Y[index])
rect = @com_graphics[index].bitmap.text_size(GB::COMMAND_TEXT[index])
@com_graphics[index].bitmap.draw_text(0,0,rect.width,rect.height,GB::COMMAND_TEXT[index])
end
end
#--------------------------------------------------------------------------
# * Dispose of Command Graphics
#--------------------------------------------------------------------------
def dispose_command_graphics
for com in @com_graphics
com.dispose unless com.nil?
end
@command_window.dispose
end
def close_command_window
return
end
#==============================================================================
# ** Main
#------------------------------------------------------------------------------
# After defining each class, actual processing begins here.
#==============================================================================
begin
Font.default_name = ["Bookman Old Style","Verdana"]
Font.default_size = 18
Font.default_bold = false
Font.default_italic = false
Graphics.freeze
$scene = Scene_PreTitle.new
$scene.main while $scene != nil
Graphics.transition(30)
rescue Errno::ENOENT
filename = $!.message.sub("No such file or directory - ", "")
print("Unable to find file #{filename}.")
end
end |