Night.png);">
Apprendre


Vous êtes
nouveau sur
Oniromancie?

Visite guidée
du site


Découvrir
RPG Maker

RM 95
RM 2000/2003
RM XP
RM VX/VX Ace
RM MV/MZ

Apprendre
RPG Maker

Tutoriels
Guides
Making-of

Dans le
Forum

Section Entraide

Tutos: Checklist de la composition (...) / Sorties: Dread Mac Farlane - episode 8 / Sorties: Dread Mac Farlane - episode 7 / Jeux: Ce qui vit Dessous / News: Quoi de neuf sur Oniromancie (...) / Chat

Bienvenue
visiteur !




publicité RPG Maker!

Statistiques

Liste des
membres


Contact

Mentions légales

477 connectés actuellement

29380434 visiteurs
depuis l'ouverture

9801 visiteurs
aujourd'hui



Barre de séparation

Partenaires

Indiexpo

Akademiya RPG Maker

Blog Alioune Fall

Fairy Tail Constellations

Planète Glutko

Level Up!

Alex d'Or

Lumen

Tous nos partenaires

Devenir
partenaire



forums

Index du forum > Entraide > Mon 1er menu en script. Des conseils ? [MAJ 05/11/14]


spyrojojo - posté le 04/11/2014 à 02:41:59 (773 messages postés)

❤ 0

schizophrène avec tendance cleptomane a votre service

Bonsoir les gens. Pour mon projet j'ai donc décidé de faire un menu 100% perso en script (Ouai mais tu pouvais le faire en event bidon ! Je sais mais je voulais devenir plus polyvalent ^^.)

Je solicite votre aide pour m'aider a le finir proprement ^^

Chose que je souhaite changer/ajouter par la suite :

Spoiler (cliquez pour afficher)



Voila le script actuelement : (Date du 06/11/14)

Portion de code : Tout sélectionner

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
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
###############################################################################
#########               Simple menu pause par SPYROJOJO               #########
#########                          V 0.0.2                            #########
###############################################################################
class Scene_Menu < Scene_MenuBase
  def start
    super
    create_choixbase
    create_Pause
  end
  def create_choixbase
    @window_selection = Window_Choixbase.new(192, 136)
    @window_selection.set_handler(:reprendre, method(:reprendre))
    @window_selection.set_handler(:atlas, method(:atlas))
    @window_selection.set_handler(:charger, method(:charger))
    @window_selection.set_handler(:sauver, method(:sauver))
    @window_selection.set_handler(:Quitter, method(:quitter))
    @window_selection.set_handler(:cancel, method(:return_scene))
  end
  #--------------------------------------------------------------------------
  # * Commande Repredre
  #--------------------------------------------------------------------------
  def reprendre
  SceneManager.goto(Scene_Map)
end
  #--------------------------------------------------------------------------
  # * Commande Atlas
  #--------------------------------------------------------------------------
  def atlas
  SceneManager.call(Scene_Atlas)
end
  #--------------------------------------------------------------------------
  # * Commande Charger
  #--------------------------------------------------------------------------
  def charger
  SceneManager.call(Scene_Load)
end
  #--------------------------------------------------------------------------
  # * Commande Sauvegarder
  #--------------------------------------------------------------------------
  def sauver
  SceneManager.call(Scene_Save)
end
  #--------------------------------------------------------------------------
  # * Commande Quitter
  #--------------------------------------------------------------------------
  def quitter
  SceneManager.call(Scene_End)
end
  #--------------------------------------------------------------------------
  # * Fenétre pour le texte Pause
  #--------------------------------------------------------------------------
  def create_Pause
  @Ptitle = Window_Pause.new
  end
end
  #--------------------------------------------------------------------------
  # * Class pour la fenétre du texte pause
  #--------------------------------------------------------------------------
class Window_Pause < Window_Base  
  def initialize
    super(192, 94, 160, 46)
    self.contents.draw_text(40, 0, 320, 32, "PAUSE")
  end
end
  #--------------------------------------------------------------------------
  # * Class pour la liste de selection
  #--------------------------------------------------------------------------
class Window_Choixbase < Window_Command
    def make_command_list
    add_command("Reprendre", :reprendre)
    add_command("Atlas", :atlas)
    add_command("Charger", :charger)
    add_command("Sauvegarder", :sauver)
    add_command("Quitter", :quitter)
  end
end
###############################################################################
####                               ATLAS                                   ####
###############################################################################
class Scene_Atlas < Scene_MenuBase
  def start
    super
    create_Titre
    create_selec
    create_Liste
  end
  #--------------------------------------------------------------------------
  # Fenetre de titre
  #--------------------------------------------------------------------------
  def create_Titre
    @Wtitle = Window_Titre.new
  end
  #--------------------------------------------------------------------------
  # * Affichage des niveaux et icones
  #--------------------------------------------------------------------------
  def create_Liste #Creation de toute les window
    @Ltitle0 = Window_Liste.new
    @Ltitle1 = Window_Liste1.new
    @Ltitle2 = Window_Liste2.new
    @Ltitle3 = Window_Liste3.new
    hide_all_list #on les masque
    @Ltitle0.show #on affiche uniquement la première
  end
  #--------------------------------------------------------------------------
  # * Menu de selection
  #--------------------------------------------------------------------------
  def create_selec
    @window_selection = Window_selec.new(1, 130)
    @window_selection.set_handler(:monde1, method(:monde1))
    @window_selection.set_handler(:monde2, method(:monde2))
    @window_selection.set_handler(:monde3, method(:monde3))
    @window_selection.set_handler(:monde4, method(:monde4))
    @window_selection.set_handler(:cancel, method(:return_scene))
  end
  def monde1
    #@Ltitle = Window_Liste.new
  end
  def monde2
    #@Ltitle = Window_Liste1.new
  end
  def monde3
    #@Ltitle = Window_Liste2.new
  end
  def monde4
    #@Ltitle = Window_Liste3.new
  end
  
  def update #update lors du mouvement du curseur
    super
    case @window_selection.index #récuperation de la position du curseur
    when 0;#si on est a l'index 0
      hide_all_list#on cache tout
      @Ltitle0.show#on affiche l'index 0
    when 1;#...
      hide_all_list
      @Ltitle1.show
    when 2;
      hide_all_list
      @Ltitle2.show
    when 3;
      hide_all_list
      @Ltitle3.show
    end
  end
  
  def hide_all_list#Cacher toute les liste
    @Ltitle0.hide
    @Ltitle1.hide
    @Ltitle2.hide
    @Ltitle3.hide
  end
 
end
  #--------------------------------------------------------------------------
  # Class windows pour le titre
  #--------------------------------------------------------------------------
class Window_Titre < Window_Base  
  def initialize
    super(0, 82, 544, 46)
    self.contents.draw_text(224, 0, 320, 32, "ATLAS")
  end
end
  #--------------------------------------------------------------------------
  # * Class windows pour la liste des niveaux et icones
  #--------------------------------------------------------------------------
class Window_Liste < Window_Base  
  def initialize
    super(0, 180, 544, 234)
    refresh
  end
  def refresh
    self.contents.clear
    bitmap = Cache.system("Iconset")
    icon_index = 1
    icon_index2 = 2
    rect = Rect.new(icon_index % 16 * 24, icon_index / 16 * 24, 24, 24)
    rect2 = Rect.new(icon_index2 % 16 * 24, icon_index2 / 16 * 24, 24, 24)
    contents.blt(250, 0, bitmap, rect)
    contents.blt(320, 0, bitmap, rect2)
    self.contents.draw_text(0, 30, 320, 32,  "Ile verdoyante")
    self.contents.draw_text(0, 50, 320, 32,  "Collines de pierre")
    self.contents.draw_text(0, 70, 320, 32,  "Ruine antique")
    self.contents.draw_text(0, 90, 320, 32,  "Grand terrier")
    self.contents.draw_text(0, 110, 320, 32, "Vol de jour")
    self.contents.draw_text(0, 130, 320, 32, "Amarr")
  end
end
###############################################################################
class Window_Liste1 < Window_Base  
  def initialize
    super(0, 180, 544, 234)
    refresh
  end
  def refresh
    self.contents.clear
    bitmap = Cache.system("Iconset")
    icon_index = 1
    icon_index2 = 2
    rect = Rect.new(icon_index % 16 * 24, icon_index / 16 * 24, 24, 24)
    rect2 = Rect.new(icon_index2 % 16 * 24, icon_index2 / 16 * 24, 24, 24)
    contents.blt(200, 0, bitmap, rect)
    contents.blt(260, 0, bitmap, rect2)
    self.contents.draw_text(0, 30, 320, 32,  "Ile feuillue")
    self.contents.draw_text(0, 50, 320, 32,  "Forêt enchantée")
    self.contents.draw_text(0, 70, 320, 32,  "bosquet ensoleillé")
    self.contents.draw_text(0, 90, 320, 32,  "Grande cabane")
    self.contents.draw_text(0, 110, 320, 32, "Vol de crépuscule")
    self.contents.draw_text(0, 130, 320, 32, "Ankum")
  end
end
###############################################################################
class Window_Liste2 < Window_Base  
  def initialize
    super(0, 180, 544, 234)
    refresh
  end
  def refresh
    self.contents.clear
    bitmap = Cache.system("Iconset")
    icon_index = 1
    icon_index2 = 2
    rect = Rect.new(icon_index % 16 * 24, icon_index / 16 * 24, 24, 24)
    rect2 = Rect.new(icon_index2 % 16 * 24, icon_index2 / 16 * 24, 24, 24)
    contents.blt(200, 0, bitmap, rect)
    contents.blt(260, 0, bitmap, rect2)
    self.contents.draw_text(0, 30, 320, 32,  "Ile givrée")
    self.contents.draw_text(0, 50, 320, 32,  "Grande toundra")
    self.contents.draw_text(0, 70, 320, 32,  "Pic glacé")
    self.contents.draw_text(0, 90, 320, 32,  "Caverne givrée")
    self.contents.draw_text(0, 110, 320, 32, "Vol de nuit")
    self.contents.draw_text(0, 130, 320, 32, "Demerr")
  end
end
###############################################################################
class Window_Liste3 < Window_Base  
  def initialize
    super(0, 180, 544, 234)
    refresh
  end
  def refresh
    self.contents.clear
    bitmap = Cache.system("Iconset")
    icon_index = 1
    icon_index2 = 2
    rect = Rect.new(icon_index % 16 * 24, icon_index / 16 * 24, 24, 24)
    rect2 = Rect.new(icon_index2 % 16 * 24, icon_index2 / 16 * 24, 24, 24)
    contents.blt(200, 0, bitmap, rect)
    contents.blt(260, 0, bitmap, rect2)
    self.contents.draw_text(0, 30, 320, 32,  "Ile de Jester")
    self.contents.draw_text(0, 50, 320, 32,  "Plaine cendrée")
    self.contents.draw_text(0, 70, 320, 32,  "grottes volcanique")
    self.contents.draw_text(0, 90, 320, 32,  "Jester")
    self.contents.draw_text(0, 110, 320, 32, "Galerie de jester")
  end
end
  #--------------------------------------------------------------------------
  # * Class windows pour la liste de selection
  #--------------------------------------------------------------------------
class Window_selec < Window_HorzCommand
    def window_width
    @window_width = 542
  end
 def make_command_list
    add_command("Ile verdoyante", :monde1)
    add_command("Ile feuillue", :monde2)
    add_command("Ile givrée", :monde3)
    add_command("Ile de Jester", :monde4)
  end
end
  



Mes projets : Fall, Délirium | Mes scripts : BGM et BGS dans le menu | Mon deviantart


Necromandien - posté le 04/11/2014 à 12:56:40 (156 messages postés)

❤ 0

Des p'tits trous, des p'tits trous, TOUJOURS DES P'TITS TROUS !!!

Pas mal, un petit menu tout simple tout kawaï :sourire3

Le Atlas c'est pour la map World ?

J'attend la suite du script :biere

Un magicien n'est jamais en retard, ni en avance d'ailleurs, il arrive précisément à l'heure prévue !


spyrojojo - posté le 04/11/2014 à 13:25:49 (773 messages postés)

❤ 0

schizophrène avec tendance cleptomane a votre service

Merci :D.
L'atlas sera un petit menu supplémentaire qui répertorie chaque niveau et permettant de voir le nombre de joyau/gemme récupéré dans chacun d'entre eux (Fangame Spyro .).

EDIT : J'ai commencer mon Atlas , mais je n'arrive pas a trouver comment mètre du texte dans les fenêtre créé :p

voila la portion de code de l'atlas :

Portion de code : Tout sélectionner

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
###############################################################################
####                               ATLAS                                   ####
###############################################################################
class Scene_Atlas < Scene_Base
  def start
    super
    create_background
    create_Titre
    create_Liste
    create_selec
  end
    def create_background
    @background_sprite = Sprite.new
    @background_sprite.bitmap = SceneManager.background_bitmap
    @background_sprite.color.set(16, 16, 16, 0)
  end
  def create_Titre
   @Wtitle = Window_Titre.new
 end
   def create_Liste
   @Ltitle = Window_Liste.new
 end
   def create_selec
   @window_selection = Window_selec.new(0, 44)
 end
end
class Window_Titre < Window_Base  
  def initialize
    super(0, 0, 160, 42)
  end
end
 
class Window_Liste < Window_Base  
  def initialize
    super(162, 0, 382, 416)
  end
end
 
class Window_selec < Window_Command
  
  def make_command_list
    add_command("Monde 1", :R1)
    add_command("Monde 2", :M2)
    add_command("Monde 3", :M3)
    add_command("Monde 4", :M4)
  end
end
  



Mes projets : Fall, Délirium | Mes scripts : BGM et BGS dans le menu | Mon deviantart


Ephy - posté le 04/11/2014 à 17:33:14 (30084 messages postés) - honor

❤ 0

[BIG SHOT]

Y'a moyen de voir ce que ça donne en screen?
Sinon juste comme ça par curiosité t'as utilisé quoi pour apprendre les bases du ruby (vu comme ça là ça a pas l'air hyper compliqué mais y'a quelques trucs dont j'ai du mal à saisir la fonction).



Power Level: 1 148 355,38|Mystic Slayer (Value!+)|Le monde d'Adélaïde|Reikon no Yume|★ H-Project|Toho Danmaku Arena|Loli versus Ponies|Mes vidéos|Ma galerie|Débuter sur VX:10, 11|Tuto: Importation de ressources|Mapper avec les RTP VX|Touhou|Fan de Omenides|Fan de Estheone|Eph'ille: 14


spyrojojo - posté le 04/11/2014 à 17:53:47 (773 messages postés)

❤ 0

schizophrène avec tendance cleptomane a votre service

J'ai uniquement utilisé le script de S4suke sur le site de la biloucorps ainsi que quelques tutos sur la V4 (pour générer des fenêtres malheureusement vides)

Le menu pause : (je dois modifier le Windows-skin et quelque truc mais le system de base et théoriquement fini, du moins de mon point de vue)
image

l'atlas : (ou je cherche comment afficher du texte dans les fenêtres vides ^^ et afficher des variables provenant du jeu par là même ocaz)
image

Mes projets : Fall, Délirium | Mes scripts : BGM et BGS dans le menu | Mon deviantart


Ephy - posté le 04/11/2014 à 18:13:18 (30084 messages postés) - honor

❤ 0

[BIG SHOT]

Ah ouais sympa. S'pas mal du tout en fait :sourit
GG. Et merci pour les infos.



Power Level: 1 148 355,38|Mystic Slayer (Value!+)|Le monde d'Adélaïde|Reikon no Yume|★ H-Project|Toho Danmaku Arena|Loli versus Ponies|Mes vidéos|Ma galerie|Débuter sur VX:10, 11|Tuto: Importation de ressources|Mapper avec les RTP VX|Touhou|Fan de Omenides|Fan de Estheone|Eph'ille: 14


Rajang - posté le 04/11/2014 à 19:00:02 (68 messages postés)

❤ 0

Simple makeur. Mais c'est déja ça.

Pour écrire du texte : en dessous de

Portion de code : Tout sélectionner

1
2
3
4
5
 
 
def create_Titre
   @Wtitle = Window_Titre.new
 end



Tu écris :

Portion de code : Tout sélectionner

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
 
def create_commands
    @window_selection = Window_List.new(0, 48)
    @window_selection.set_handler(:R1, method(:R1))
    @window_selection.set_handler(:R1, method(:M2))
    #etc
end
 
def create_window_message
    @message = Window_Base.new(160, 48, 480, 432)
end
  
def display_message(text)
    @message.draw_text(0, 20, 600, 80, text)  # Ici les coordonnées de texte par rapport à la fenètre
end
 
def R1
  display_message("Ceci est le monde 1")
end
 



Voila ! Ça devrait marcher ^^ :)

EDIT : Oups ça marche pas, mais c'est presque ça. Attends un peu et je le corrige !

Mon histoire interactive : https://amethysts.itch.io/coalescence


spyrojojo - posté le 04/11/2014 à 19:07:15 (773 messages postés)

❤ 0

schizophrène avec tendance cleptomane a votre service

Merci a vous 2 ^^ , je ferait des test ce soir :p (j'adore scripter comme sa ^^)

Mes projets : Fall, Délirium | Mes scripts : BGM et BGS dans le menu | Mon deviantart


Rajang - posté le 04/11/2014 à 19:18:13 (68 messages postés)

❤ 0

Simple makeur. Mais c'est déja ça.

Bon. J'en suis à là, mais ça bugue... :doute5 Comme tu peux le voir j'ai pas mal modifié ton script de départ ^^ Je pense que je suis pas loin, mais... j'y arrive pas ^^' Bon, je te le mets quand même, si jamais quelqu'un a envie de modifier. HELP !

Portion de code : Tout sélectionner

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
###############################################################################
####                               ATLAS                                   ####
###############################################################################
class Scene_Atlas < Scene_Base
  def start
    super
    create_background
    create_Titre
    create_Liste
    create_selec
  end
    def create_background
    @background_sprite = Sprite.new
    @background_sprite.bitmap = SceneManager.background_bitmap
    @background_sprite.color.set(16, 16, 16, 0)
  end
  def create_Titre
   @Wtitle = Window_Titre.new
 end
   def create_Liste
   @Ltitle = Window_Liste.new
 end
   def create_selec
   @window_selection = Window_selec.new(0, 44)
   @window_selection.set_handler(:R1, method(:R1))
   @window_selection.set_handler(:M2, method(:M2))
   @window_selection.set_handler(:M3, method(:M3))
   @window_selection.set_handler(:M4, method(:M4))
 end
   def display_message(text)
   @message.draw_text(0, 20, 100, 80, text)  # Ici les coordonnées de texte par rapport à la fenètre
   @message.show
 end
  def R1
    display_message("Ceci est le monde 1")
    SceneManager.call(Scene_Atlas)
  end
  def M2
    display_message("Ceci est le monde 2")
    SceneManager.call(Scene_Atlas)
  end
  def M3
    display_message("Ceci est le monde 3")
    SceneManager.call(Scene_Atlas)
  end
  def M4
    display_message("Ceci est le monde 4")
    SceneManager.call(Scene_Atlas)
  end
 
 end
class Window_Titre < Window_Base  
  def initialize
    super(0, 0, 160, 42)
  end
end
 
class Window_Liste < Window_Base  
  def initialize
    super(162, 0, 382, 416)
  end
end
 
class Window_selec < Window_Command
  
  def make_command_list
    add_command("Monde 1", :R1)
    add_command("Monde 2", :M2)
    add_command("Monde 3", :M3)
    add_command("Monde 4", :M4)
  end
end
  



Mon histoire interactive : https://amethysts.itch.io/coalescence


spyrojojo - posté le 04/11/2014 à 20:15:40 (773 messages postés)

❤ 0

schizophrène avec tendance cleptomane a votre service

Merci de ton aide^^

Mes projets : Fall, Délirium | Mes scripts : BGM et BGS dans le menu | Mon deviantart


f1rstone - posté le 04/11/2014 à 20:16:02 (14 messages postés)

❤ 0

Salut tout le monde, pour afficher les messages, c'est pas plutot sous Window_Liste que tu met le contenu de cette grande fenetre ?

j'ai essayé comme ceci :

Portion de code : Tout sélectionner

1
2
3
4
5
6
7
8
9
class Window_Liste < Window_Base  
  def initialize
    super(162, 0, 382, 416)
    self.contents.draw_text(4, 0, 320, 32, "Ceci est le monde 1")
  #permet d'afficher le contenu de la fenetre
    self.contents.draw_text(4, 20, 320, 32, "Ceci est le monde 2")
  #etc
  end
end



et ca a l'air de marcher


spyrojojo - posté le 04/11/2014 à 20:42:02 (773 messages postés)

❤ 0

schizophrène avec tendance cleptomane a votre service

J'ai fait un test rapide avec ton code f1rstone et ça fonctionne parfaitement ^^

EDIT : Fin des tests pour ce soir ^^

Coter nouveauté :
-ajout d'un texte "PAUSE" sur le menu de début.
-Ajout d'une commande pour quitter le menu avec ECHAP.
-Ajout du titres dans le menu ATLAS.
-Ajout des 2 premières icônes sur l'affichage des futurs niveaux.

Coter code j'en suis à ça :

Portion de code : Tout sélectionner

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
###############################################################################
#########               Simple menu pause par SPYROJOJO               #########
#########                          V 0.0.2                            #########
###############################################################################
class Scene_MenuBase < Scene_Base
  def start
    super
    create_background
  end
  def create_background
    @background_sprite = Sprite.new
    @background_sprite.bitmap = SceneManager.background_bitmap
    @background_sprite.color.set(16, 16, 16, 0)
  end
end
 
class Scene_Menu < Scene_MenuBase
  def start
    super
    create_choixbase
    create_Pause
  end
  def create_choixbase
    @window_selection = Window_Choixbase.new(192, 136)
    @window_selection.set_handler(:RP, method(:RP))
    @window_selection.set_handler(:AT, method(:AT))
    @window_selection.set_handler(:CH, method(:CH))
    @window_selection.set_handler(:SV, method(:SV))
    @window_selection.set_handler(:QT, method(:QT))
    @window_selection.set_handler(:cancel, method(:return_scene))
  end
  def RP
  SceneManager.goto(Scene_Map)
  end
  def AT
  SceneManager.call(Scene_Atlas)
  end
  def CH
  SceneManager.call(Scene_Load)
  end
  def SV
  SceneManager.call(Scene_Save)
  end
  def QT
  SceneManager.call(Scene_End)
  end
  def create_Pause
  @Ptitle = Window_Pause.new
  end
end
 
class Window_Pause < Window_Base  
  def initialize
    super(192, 94, 160, 46)
    self.contents.draw_text(40, 0, 320, 32, "PAUSE")
  end
end
class Window_Choixbase < Window_Command
  
  def make_command_list
    add_command("Reprendre", :RP)
    add_command("Atlas", :AT)
    add_command("Charger", :CH)
    add_command("Sauvegarder", :SV)
    add_command("Quitter", :QT)
  end
end
###############################################################################
####                               ATLAS                                   ####
###############################################################################
class Scene_Atlas < Scene_Base
  def start
    super
    create_background
    create_Titre
    create_Liste
    create_selec
  end
    def create_background
    @background_sprite = Sprite.new
    @background_sprite.bitmap = SceneManager.background_bitmap
    @background_sprite.color.set(16, 16, 16, 0)
  end
  def create_Titre
   @Wtitle = Window_Titre.new
 end
   def create_Liste
   @Ltitle = Window_Liste.new
 end
   def create_selec
   @window_selection = Window_selec.new(0, 48)
   @window_selection.set_handler(:cancel, method(:return_scene))
 end
end
class Window_Titre < Window_Base  
  def initialize
    super(0, 0, 160, 46)
    self.contents.draw_text(40, 0, 320, 32, "ATLAS")
  end
end
 
class Window_Liste < Window_Base  
  def initialize
    super(162, 0, 382, 416)
    refresh
  end
  def refresh
    self.contents.clear
    bitmap = Cache.system("Iconset")
    icon_index = 1
    icon_index2 = 2
    rect = Rect.new(icon_index % 16 * 24, icon_index / 16 * 24, 24, 24)
    rect2 = Rect.new(icon_index2 % 16 * 24, icon_index2 / 16 * 24, 24, 24)
    contents.blt(200, 0, bitmap, rect)
    contents.blt(260, 0, bitmap, rect2)
  end
end
 
class Window_selec < Window_Command
  
  def make_command_list
    add_command("Ile verdoyante", :R1)
    add_command("Ile feuillue", :M2)
    add_command("Ile givrée", :M3)
    add_command("Ile de Jester", :M4)
  end
end
  



et visuellement a ça :
image
image

Mon objectif de demain et de rendre le menu de sélection des Mondes a l'horizontal (afin d'avoir un atlas plus proche du 1er spyro)

EDIT 2 :


Coter nouveauté :
-Passage a l'horizontal du menu de selection de l'atlas
-Menu de selection effectuer et fonctionel)

Portion de code : Tout sélectionner

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
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
###############################################################################
#########               Simple menu pause par SPYROJOJO               #########
#########                          V 0.0.2                            #########
###############################################################################
class Scene_Menu < Scene_MenuBase
  def start
    super
    create_choixbase
    create_Pause
  end
  def create_choixbase
    @window_selection = Window_Choixbase.new(192, 136)
    @window_selection.set_handler(:reprendre, method(:reprendre))
    @window_selection.set_handler(:atlas, method(:atlas))
    @window_selection.set_handler(:charger, method(:charger))
    @window_selection.set_handler(:sauver, method(:sauver))
    @window_selection.set_handler(:Quitter, method(:quitter))
    @window_selection.set_handler(:cancel, method(:return_scene))
  end
  #--------------------------------------------------------------------------
  # * Commande Repredre
  #--------------------------------------------------------------------------
  def reprendre
  SceneManager.goto(Scene_Map)
end
  #--------------------------------------------------------------------------
  # * Commande Atlas
  #--------------------------------------------------------------------------
  def atlas
  SceneManager.call(Scene_Atlas)
end
  #--------------------------------------------------------------------------
  # * Commande Charger
  #--------------------------------------------------------------------------
  def charger
  SceneManager.call(Scene_Load)
end
  #--------------------------------------------------------------------------
  # * Commande Sauvegarder
  #--------------------------------------------------------------------------
  def sauver
  SceneManager.call(Scene_Save)
end
  #--------------------------------------------------------------------------
  # * Commande Quitter
  #--------------------------------------------------------------------------
  def quitter
  SceneManager.call(Scene_End)
end
  #--------------------------------------------------------------------------
  # * Fenétre pour le texte Pause
  #--------------------------------------------------------------------------
  def create_Pause
  @Ptitle = Window_Pause.new
  end
end
  #--------------------------------------------------------------------------
  # * Class pour la fenétre du texte pause
  #--------------------------------------------------------------------------
class Window_Pause < Window_Base  
  def initialize
    super(192, 94, 160, 46)
    self.contents.draw_text(40, 0, 320, 32, "PAUSE")
  end
end
  #--------------------------------------------------------------------------
  # * Class pour la liste de selection
  #--------------------------------------------------------------------------
class Window_Choixbase < Window_Command
    def make_command_list
    add_command("Reprendre", :reprendre)
    add_command("Atlas", :atlas)
    add_command("Charger", :charger)
    add_command("Sauvegarder", :sauver)
    add_command("Quitter", :quitter)
  end
end
###############################################################################
####                               ATLAS                                   ####
###############################################################################
class Scene_Atlas < Scene_MenuBase
  def start
    super
    create_Titre
    create_selec
    create_Liste
  end
  #--------------------------------------------------------------------------
  # Fenetre de titre
  #--------------------------------------------------------------------------
  def create_Titre
    @Wtitle = Window_Titre.new
  end
  #--------------------------------------------------------------------------
  # * Affichage des niveaux et icones
  #--------------------------------------------------------------------------
  def create_Liste #Creation de toute les window
    @Ltitle0 = Window_Liste.new
    @Ltitle1 = Window_Liste1.new
    @Ltitle2 = Window_Liste2.new
    @Ltitle3 = Window_Liste3.new
    hide_all_list #on les masque
    @Ltitle0.show #on affiche uniquement la première
  end
  #--------------------------------------------------------------------------
  # * Menu de selection
  #--------------------------------------------------------------------------
  def create_selec
    @window_selection = Window_selec.new(1, 130)
    @window_selection.set_handler(:monde1, method(:monde1))
    @window_selection.set_handler(:monde2, method(:monde2))
    @window_selection.set_handler(:monde3, method(:monde3))
    @window_selection.set_handler(:monde4, method(:monde4))
    @window_selection.set_handler(:cancel, method(:return_scene))
  end
  def monde1
    #@Ltitle = Window_Liste.new
  end
  def monde2
    #@Ltitle = Window_Liste1.new
  end
  def monde3
    #@Ltitle = Window_Liste2.new
  end
  def monde4
    #@Ltitle = Window_Liste3.new
  end
  
  def update #update lors du mouvement du curseur
    super
    case @window_selection.index #récuperation de la position du curseur
    when 0;#si on est a l'index 0
      hide_all_list#on cache tout
      @Ltitle0.show#on affiche l'index 0
    when 1;#...
      hide_all_list
      @Ltitle1.show
    when 2;
      hide_all_list
      @Ltitle2.show
    when 3;
      hide_all_list
      @Ltitle3.show
    end
  end
  
  def hide_all_list#Cacher toute les liste
    @Ltitle0.hide
    @Ltitle1.hide
    @Ltitle2.hide
    @Ltitle3.hide
  end
 
end
  #--------------------------------------------------------------------------
  # Class windows pour le titre
  #--------------------------------------------------------------------------
class Window_Titre < Window_Base  
  def initialize
    super(0, 82, 544, 46)
    self.contents.draw_text(224, 0, 320, 32, "ATLAS")
  end
end
  #--------------------------------------------------------------------------
  # * Class windows pour la liste des niveaux et icones
  #--------------------------------------------------------------------------
class Window_Liste < Window_Base  
  def initialize
    super(0, 180, 544, 234)
    refresh
  end
  def refresh
    self.contents.clear
    bitmap = Cache.system("Iconset")
    icon_index = 1
    icon_index2 = 2
    rect = Rect.new(icon_index % 16 * 24, icon_index / 16 * 24, 24, 24)
    rect2 = Rect.new(icon_index2 % 16 * 24, icon_index2 / 16 * 24, 24, 24)
    contents.blt(250, 0, bitmap, rect)
    contents.blt(320, 0, bitmap, rect2)
    self.contents.draw_text(0, 30, 320, 32,  "Ile verdoyante")
    self.contents.draw_text(0, 50, 320, 32,  "Collines de pierre")
    self.contents.draw_text(0, 70, 320, 32,  "Ruine antique")
    self.contents.draw_text(0, 90, 320, 32,  "Grand terrier")
    self.contents.draw_text(0, 110, 320, 32, "Vol de jour")
    self.contents.draw_text(0, 130, 320, 32, "Amarr")
  end
end
###############################################################################
class Window_Liste1 < Window_Base  
  def initialize
    super(0, 180, 544, 234)
    refresh
  end
  def refresh
    self.contents.clear
    bitmap = Cache.system("Iconset")
    icon_index = 1
    icon_index2 = 2
    rect = Rect.new(icon_index % 16 * 24, icon_index / 16 * 24, 24, 24)
    rect2 = Rect.new(icon_index2 % 16 * 24, icon_index2 / 16 * 24, 24, 24)
    contents.blt(200, 0, bitmap, rect)
    contents.blt(260, 0, bitmap, rect2)
    self.contents.draw_text(0, 30, 320, 32,  "Ile feuillue")
    self.contents.draw_text(0, 50, 320, 32,  "Forêt enchantée")
    self.contents.draw_text(0, 70, 320, 32,  "bosquet ensoleillé")
    self.contents.draw_text(0, 90, 320, 32,  "Grande cabane")
    self.contents.draw_text(0, 110, 320, 32, "Vol de crépuscule")
    self.contents.draw_text(0, 130, 320, 32, "Ankum")
  end
end
###############################################################################
class Window_Liste2 < Window_Base  
  def initialize
    super(0, 180, 544, 234)
    refresh
  end
  def refresh
    self.contents.clear
    bitmap = Cache.system("Iconset")
    icon_index = 1
    icon_index2 = 2
    rect = Rect.new(icon_index % 16 * 24, icon_index / 16 * 24, 24, 24)
    rect2 = Rect.new(icon_index2 % 16 * 24, icon_index2 / 16 * 24, 24, 24)
    contents.blt(200, 0, bitmap, rect)
    contents.blt(260, 0, bitmap, rect2)
    self.contents.draw_text(0, 30, 320, 32,  "Ile givrée")
    self.contents.draw_text(0, 50, 320, 32,  "Grande toundra")
    self.contents.draw_text(0, 70, 320, 32,  "Pic glacé")
    self.contents.draw_text(0, 90, 320, 32,  "Caverne givrée")
    self.contents.draw_text(0, 110, 320, 32, "Vol de nuit")
    self.contents.draw_text(0, 130, 320, 32, "Demerr")
  end
end
###############################################################################
class Window_Liste3 < Window_Base  
  def initialize
    super(0, 180, 544, 234)
    refresh
  end
  def refresh
    self.contents.clear
    bitmap = Cache.system("Iconset")
    icon_index = 1
    icon_index2 = 2
    rect = Rect.new(icon_index % 16 * 24, icon_index / 16 * 24, 24, 24)
    rect2 = Rect.new(icon_index2 % 16 * 24, icon_index2 / 16 * 24, 24, 24)
    contents.blt(200, 0, bitmap, rect)
    contents.blt(260, 0, bitmap, rect2)
    self.contents.draw_text(0, 30, 320, 32,  "Ile de Jester")
    self.contents.draw_text(0, 50, 320, 32,  "Plaine cendrée")
    self.contents.draw_text(0, 70, 320, 32,  "grottes volcanique")
    self.contents.draw_text(0, 90, 320, 32,  "Jester")
    self.contents.draw_text(0, 110, 320, 32, "Galerie de jester")
  end
end
  #--------------------------------------------------------------------------
  # * Class windows pour la liste de selection
  #--------------------------------------------------------------------------
class Window_selec < Window_HorzCommand
    def window_width
    @window_width = 542
  end
 def make_command_list
    add_command("Ile verdoyante", :monde1)
    add_command("Ile feuillue", :monde2)
    add_command("Ile givrée", :monde3)
    add_command("Ile de Jester", :monde4)
  end
end



et visuellement a ça :
image

Me reste a faire :
-Empéché/bloquer la selection du joueur car elle a été automatisé
-Afficher le contenue des variables dans la liste de niveau de l'atlas
-ajout d'un menu aide
-pauffinage

Mes projets : Fall, Délirium | Mes scripts : BGM et BGS dans le menu | Mon deviantart

Index du forum > Entraide > Mon 1er menu en script. Des conseils ? [MAJ 05/11/14]

repondre up

Suite à de nombreux abus, le post en invités a été désactivé. Veuillez vous inscrire si vous souhaitez participer à la conversation.

Haut de page

Merci de ne pas reproduire le contenu de ce site sans autorisation.
Contacter l'équipe - Mentions légales

Plan du site

Communauté: Accueil | Forum | Chat | Commentaires | News | Flash-news | Screen de la semaine | Sorties | Tests | Gaming-Live | Interviews | Galerie | OST | Blogs | Recherche
Apprendre: Visite guidée | RPG Maker 95 | RPG Maker 2003 | RPG Maker XP | RPG Maker VX | RPG Maker MV | Tutoriels | Guides | Making-of
Télécharger: Programmes | Scripts/Plugins | Ressources graphiques / sonores | Packs de ressources | Midis | Eléments séparés | Sprites
Jeux: Au hasard | Notre sélection | Sélection des membres | Tous les jeux | Jeux complets | Le cimetière | RPG Maker 95 | RPG Maker 2000 | RPG Maker 2003 | RPG Maker XP | RPG Maker VX | RPG Maker VX Ace | RPG Maker MV | Autres | Proposer
Ressources RPG Maker 2000/2003: Chipsets | Charsets | Panoramas | Backdrops | Facesets | Battle anims | Battle charsets | Monstres | Systems | Templates
Ressources RPG Maker XP: Tilesets | Autotiles | Characters | Battlers | Window skins | Icônes | Transitions | Fogs | Templates
Ressources RPG Maker VX: Tilesets | Charsets | Facesets | Systèmes
Ressources RPG Maker MV: Tilesets | Characters | Faces | Systèmes | Title | Battlebacks | Animations | SV/Ennemis
Archives: Palmarès | L'Annuaire | Livre d'or | Le Wiki | Divers