
Message Box Options (version 2.0.1) Script pour RPG Maker VXACE Ecrit par Tata Monos
Nom :Message Box Options
Version : (version 2.0.1)
Auteur : Zerbu
Source : Lien
Permet de régler la largeur, la hauteur, et la position du windowskin sur Rpg Maker Vxace.
Il faut 4 variables. De base :
-Variable 2 pour la largeur de la boite de dialogue. (Ligne 18 dans le script pour modifier l'id de la variable)
-Variable 3 pour la hauteur. (Ligne 22)
-Variable 4 pour la position X (Ligne 26)
-Variable 5 pour la position Y (Ligne 31)
Si une variable à pour valeur 0, elle retour à ça fonction par défaut.
Exemple si la variable Y est égale 0, c'est l'option (Haut,Milieu, bas) qui reprend le dessus pour positionner tous ça.
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
| #==============================================================================
# Message Box Options (version 2.0.1)
# NEW FEATURES:
# - You can now quickly set variables using a script call:
# -- message_box_options(width, height, x, y)
# - You can also reset the variables quickly as well
# -- message_box_options_reset
#------------------------------------------------------------------------------
# by Zerbu
#==============================================================================
module Message_Box_Options
#--------------------------------------------------------------------------
# Options
#--------------------------------------------------------------------------
# Variable with the message width
# If the variable value is 0, the full width of the window will be used
MESSAGE_WIDTH = 2
# Variable with the message height
# If the variable value is 0, the default height will be used
MESSAGE_HEIGHT = 3
# Variable with the X position
# If the variable value is -1, it will be centred on the screen
MESSAGE_X = 4
# Variable with the Y position
# If the variable value is 0, the position chosen in the editor
# (Top, Middle, Bottom) will be used
MESSAGE_Y = 5
end
#--------------------------------------------------------------------------
# DO NOT EDIT BELOW unless you know what you're doing!
# If you are not careful, editing below could cause chaos in your game
# world, and I don't mean something the player will enjoy!
#--------------------------------------------------------------------------
#--------------------------------------------------------------------------
# Window_Message
#--------------------------------------------------------------------------
class Window_Message < Window_Base
include Message_Box_Options
#--------------------------------------------------------------------------
# alias method: window_width
#--------------------------------------------------------------------------
alias default_window_width window_width
def window_width
#---
if $game_variables[MESSAGE_WIDTH] != 0
$game_variables[MESSAGE_WIDTH]
#---
else
default_window_width
end
#---
end
#--------------------------------------------------------------------------
# alias method: window_height
#--------------------------------------------------------------------------
alias default_window_height window_height
def window_height
#---
if $game_variables[MESSAGE_HEIGHT] != 0
$game_variables[MESSAGE_HEIGHT]
#---
else
default_window_height
#---
end
end
#--------------------------------------------------------------------------
# alias method: update_placement
#--------------------------------------------------------------------------
alias default_placement update_placement
#---
def update_placement
#---
if (self.width != window_width || self.height != window_height)
self.width = window_width
self.height = window_height
create_contents
end
#---
default_placement
#---
if $game_variables[MESSAGE_X] == -1
x_space = Graphics.width - window_width
self.x = x_space-(x_space/2)
#---
else
self.x = $game_variables[MESSAGE_X]
#---
end
#---
if $game_variables[5] != 0
self.y = $game_variables[MESSAGE_Y]
end
#---
end
end
#--------------------------------------------------------------------------
# >> Game_Interpreter
# Add message box option and message box option reset scripts
#--------------------------------------------------------------------------
class Game_Interpreter
include Message_Box_Options
#--------------------------------------------------------------------------
# new method: message_box_options
#--------------------------------------------------------------------------
def message_box_options(width, height, x, y)
$game_variables[MESSAGE_WIDTH] = width
$game_variables[MESSAGE_HEIGHT] = height
$game_variables[MESSAGE_X] = x
$game_variables[MESSAGE_Y] = y
end
#--------------------------------------------------------------------------
# new method: message_box_options_reset
#--------------------------------------------------------------------------
def message_box_options_reset
$game_variables[MESSAGE_WIDTH] = 0
$game_variables[MESSAGE_HEIGHT] = 0
$game_variables[MESSAGE_X] = 0
$game_variables[MESSAGE_Y] = 0
end
end
#==============================================================================
# END SCRIPT
#============================================================================== |
| 
Aucun commentaire n'a été posté pour le moment. 
|