| Villageois (Nv 1) |
 |
Inscrit le: 25 Sep 2010, 12:02 Messages: 11 Sexe: Masculin Points d'aide: 28/60
Créations :
Voir ses créations
|
Voisi un p'tit écran titre que j'ai codé pour le jeu ascension: Auteur: Adurna date de réalisation : 08/05/2010 screen:  - Code: Tout sélectionner
#============================================================= # Ascension title par Adurna le 08/05/2010 #============================================================= # Créé pour le jeu ascension # http://projet-apocalypse.forumactif.net/index.html #http://www.rpgmakervx-fr.com/projets-en-cours-f9/ascension-t5182.htm ##########################################################
module Adurna Choix = ["jouer","Site","partenaire","Crédit","Quitter"] Site = "http://projet-apocalypse.forumactif.net/index.html"#adrésse du site Partenaire = [ "comu'","autre_site","google"]#liste des partenaires Purl = ["www.rpgmakervx-fr.com","www.autre-site.fr","www.google.com"]#adréésse des partenaires Possition_en_x = 150#position en X de la fenètre Possition_en_y = 170 #position en Y de la fenètre Crédit = "credit" #nom de l'image de crédit end
class Scene_Title alias dudu_start start alias dudu_terminate terminate
def start dudu_start @choix = Window_Command.new(160,Adurna::Choix) x=Adurna::Possition_en_x y=Adurna::Possition_en_y @choix.x= x @choix.y= y @choix.active = true @choix.visible = true @choix.index = 0
@site=Window_Confirme.new @site.x= x+160 @site.y= y+24 @site.active = false @site.visible = false @site.index = 0
@partenaires = Window_Command.new(160,Adurna::Partenaire) @partenaires.x =x+160 @partenaires.y =y+48 @partenaires.active = false @partenaires.visible = false @partenaires.index = 0 end
def terminate dudu_terminate @choix.dispose @partenaires.dispose @site.dispose end
def create_command_window x=Adurna::Possition_en_x y=Adurna::Possition_en_y s1 = Vocab::new_game s2 = Vocab::continue @command_window = Window_Command.new(160, [s1, s2]) @command_window.active=false @command_window.visible = false @command_window.x =x+160 @command_window.y =y if @continue_enabled # If continue is enabled @command_window.index = 1 # Move cursor over command else # If disabled @command_window.draw_item(1, false) # Make command semi-transparent end @command_window.openness = 0 @command_window.open end def siteweb(url) url='http://'<<url if url[0..6]!='http://' Thread.new{system("explorer",url)} end
def update super #jeux if @command_window.active == true @command_window.update if Input.trigger?(Input::B) @command_window.active = false @command_window.visible = false @choix.active = true elsif Input.trigger?(Input::C) case @command_window.index when 0 #New game command_new_game when 1 # Continue command_continue end end #partenaire elsif @partenaires.active == true @partenaires.update if Input.trigger?(Input::B) @partenaires.active = false @partenaires.visible = false @choix.active = true elsif Input.trigger?(Input::C) @partenaires.active = false @partenaires.visible = false @choix.active = true siteweb(Adurna::Purl[@partenaires.index]) end #site elsif @site.active == true @site.update if Input.trigger?(Input::C) @site.active = false @site.visible = false @choix.active = true siteweb(Adurna::Site) if @site.index == 0 end # choix elsif @choix.active == true @choix.update if Input.trigger?(Input::C) case @choix.index when 0 @choix.active = false @command_window.active = true @command_window.visible =true when 1 @choix.active = false @site.active = true @site.visible =true when 2 @choix.active = false @partenaires.active = true @partenaires.visible = true when 3 $scene=Crédit.new when 4 command_shutdown end end end end end #============================================================================== # ** Window_Command #------------------------------------------------------------------------------ # This window deals with general command choices. #==============================================================================
class Window_Confirme < Window_Selectable #-------------------------------------------------------------------------- # * Public Instance Variables #-------------------------------------------------------------------------- attr_reader :commands # command #-------------------------------------------------------------------------- # * Object Initialization # width : window width # commands : command string array # column_max : digit count (if 2 or more, horizontal selection) # row_max : row count (0: match command count) # spacing : blank space when items are arrange horizontally #-------------------------------------------------------------------------- def initialize(row_max = 0, spacing = 32) if row_max == 0 row_max = 1 end super(0, 0, 230, 2 * WLH + 32, spacing) @commands = ["oui", "non"] @item_max = commands.size @column_max = 2 refresh self.index = 0 end #-------------------------------------------------------------------------- # * Refresh #-------------------------------------------------------------------------- def refresh self.contents.clear self.contents.draw_text(0, 0, self.width, WLH, "Se connecter au site?") for i in 0...@item_max draw_item(i) end end #-------------------------------------------------------------------------- # * Get rectangle for displaying items # index : item number #-------------------------------------------------------------------------- def item_rect(index) rect = Rect.new(0, 0, 0, 0) rect.width = (contents.width + @spacing) / @column_max - @spacing rect.height = WLH rect.x = index % @column_max * (rect.width + @spacing) rect.y = WLH return rect end #-------------------------------------------------------------------------- # * Draw Item # index : item number # enabled : enabled flag. When false, draw semi-transparently. #-------------------------------------------------------------------------- def draw_item(index, enabled = true) rect = item_rect(index) rect.x += 4 rect.width -= 8 self.contents.clear_rect(rect) self.contents.font.color = normal_color self.contents.font.color.alpha = enabled ? 255 : 128 self.contents.draw_text(rect, @commands[index], 1) end end
class Crédit<Scene_Base def initialize @crédit = Sprite.new @crédit.bitmap = Cache.picture(Adurna::Crédit) @crédit.x = 0 @crédit.y=0 end def terminate @crédit.dispose end def update if Input.trigger?(Input::B) $scene=Scene_Title.new end end end Edit Drow : J'ai enlevé le spoiler, la combinaison spoiler+code provoque encore plus de bug que n'a déjà la balise de code, je déplace .
|
|