RPG maker forum

Vous souhaitez réagir à ce message ? Créez un compte en quelques clics ou connectez-vous pour continuer.

Tous sur RPG maker, scripts, projet, ressources, screens, demandez, faites vous aider et aidez les autres!

Le Deal du moment : -55%
Coffret d’outils – STANLEY – ...
Voir le deal
21.99 €

3 participants

    menu tournant

    louckas
    louckas
    modérateur
    modérateur


    Messages : 116
    Réputation : 11
    Date d'inscription : 17/04/2010

    menu tournant Empty menu tournant

    Message  louckas Lun 26 Avr - 21:22

    Copiez le code, ouvrez l'éditeur de script ( F11 ) et créez en un nouveau au dessus de 'Main'.
    Nommez ce script " Ring_Menu " et collez le code :



    menu tournant ]screen.jpg - 0



    #==============================================================================
    # ¡ Window_RingMenu
    #==============================================================================
    #==============================================================================
    # Edited by MakirouAru
    #==============================================================================
    class Window_RingMenu < Window_Base
    #--------------------------------------------------------------------------
    #--------------------------------------------------------------------------
    STARTUP_FRAMES = 20 # attendre 20 frame
    MOVING_FRAMES = 5 # bouger de 5 frame
    RING_R = 64 # la variable ring_r=64
    ICON_ITEM = RPG::Cache.icon("034-Item03") # icon pour item prend l'aparence de l'icon 034-item03
    ICON_SKILL = RPG::Cache.icon("044-Skill01") # idem pour une autre aparence
    ICON_EQUIP = RPG::Cache.icon("001-Weapon01") #idem
    ICON_STATUS = RPG::Cache.icon("050-Skill07") #idem 
    ICON_SAVE = RPG::Cache.icon("038-Item07") # idem
    ICON_EXIT = RPG::Cache.icon("046-Skill03") # idem
    ICON_DISABLE= RPG::Cache.icon("") # idem
    SE_STARTUP = "056-Right02" #
    MODE_START = 1 #
    MODE_WAIT = 2 #
    MODE_MOVER = 3 #
    MODE_MOVEL = 4 #
    #--------------------------------------------------------------------------
    #
    #--------------------------------------------------------------------------
    attr_accessor :index
    #--------------------------------------------------------------------------
    # 
    #--------------------------------------------------------------------------
    def initialize( center_x, center_y )
    super(0, 0, 640, 480)
    self.contents = Bitmap.new(width-32, height-32)
    self.contents.font.name = "Arial"
    self.opacity = 0
    self.back_opacity = 0
    s1 = "Objets"
    s2 = "Compétences"
    s3 = "Equipement"
    s4 = "Etats"
    s5 = "Sauvegarder"
    s6 = "Quitter"
    @commands = [ s1, s2, s3, s4, s5, s6 ]
    @item_max = 6
    @index = 0
    @items = [ ICON_ITEM, ICON_SKILL, ICON_EQUIP, ICON_STATUS, ICON_SAVE, ICON_EXIT ]
    @disabled = [ false, false, false, false, false, false ]
    @cx = center_x - 16
    @cy = center_y - 16
    setup_move_start
    refresh
    end
    #--------------------------------------------------------------------------
    # 
    #--------------------------------------------------------------------------
    def update
    super
    refresh
    end
    #--------------------------------------------------------------------------
    # 
    #--------------------------------------------------------------------------
    def refresh
    self.contents.clear
    #
    case @mode
    when MODE_START
    refresh_start
    when MODE_WAIT
    refresh_wait
    when MODE_MOVER
    refresh_move(1)
    when MODE_MOVEL
    refresh_move(0)
    end
    #
    rect = Rect.new(@cx - 272, @cy + 24, self.contents.width-32, 32)
    self.contents.draw_text(rect, @commands[@index],1)
    end
    #--------------------------------------------------------------------------
    #
    #--------------------------------------------------------------------------
    def refresh_start
    d1 = 2.0 * Math::PI / @item_max
    d2 = 1.0 * Math::PI / STARTUP_FRAMES
    r = RING_R - 1.0 * RING_R * @steps / STARTUP_FRAMES
    for i in 0...@item_max
    j = i - @index
    d = d1 * j + d2 * @steps
    x = @cx + ( r * Math.sin( d ) ).to_i
    y = @cy - ( r * Math.cos( d ) ).to_i
    draw_item(x, y, i)
    end
    @steps -= 1
    if @steps < 1
    @mode = MODE_WAIT
    end
    end
    #--------------------------------------------------------------------------
    # 
    #--------------------------------------------------------------------------
    def refresh_wait
    d = 2.0 * Math::PI / @item_max
    for i in 0...@item_max
    j = i - @index
    x = @cx + ( RING_R * Math.sin( d * j ) ).to_i
    y = @cy - ( RING_R * Math.cos( d * j ) ).to_i
    draw_item(x, y, i)
    end
    end
    #--------------------------------------------------------------------------
    #
    #
    #--------------------------------------------------------------------------
    def refresh_move( mode )
    d1 = 2.0 * Math::PI / @item_max
    d2 = d1 / MOVING_FRAMES
    d2 *= -1 if mode != 0
    for i in 0...@item_max
    j = i - @index
    d = d1 * j + d2 * @steps
    x = @cx + ( RING_R * Math.sin( d ) ).to_i
    y = @cy - ( RING_R * Math.cos( d ) ).to_i
    draw_item(x, y, i)
    end
    @steps -= 1
    if @steps < 1
    @mode = MODE_WAIT
    end
    end
    #--------------------------------------------------------------------------
    #
    #
    #
    #--------------------------------------------------------------------------
    def draw_item(x, y, i)
    #p "x=" + x.to_s + " y=" + y.to_s + " i=" + @items[i].to_s
    rect = Rect.new(0, 0, @items[i].width, @items[i].height)
    if @index == i
    self.contents.blt( x, y, @items[i], rect )
    if @disabled[@index]
    self.contents.blt( x, y, ICON_DISABLE, rect )
    end
    else
    self.contents.blt( x, y, @items[i], rect, 128 )
    if @disabled[@index]
    self.contents.blt( x, y, ICON_DISABLE, rect, 128 )
    end
    end
    end
    #--------------------------------------------------------------------------
    # 
    #
    #--------------------------------------------------------------------------
    def disable_item(index)
    @disabled[index] = true
    end
    #--------------------------------------------------------------------------
    #
    #--------------------------------------------------------------------------
    def setup_move_start
    @mode = MODE_START
    @steps = STARTUP_FRAMES
    if SE_STARTUP != nil and SE_STARTUP != ""
    Audio.se_play("Audio/SE/" + SE_STARTUP, 80, 100)
    end
    end
    #--------------------------------------------------------------------------
    #
    #--------------------------------------------------------------------------
    def setup_move_move(mode)
    if mode == MODE_MOVER
    @index -= 1
    @index = @items.size - 1 if @index < 0
    elsif mode == MODE_MOVEL
    @index += 1
    @index = 0 if @index >= @items.size
    else
    return
    end
    @mode = mode
    @steps = MOVING_FRAMES
    end
    #--------------------------------------------------------------------------
    #
    #--------------------------------------------------------------------------
    def animation?
    return @mode != MODE_WAIT
    end
    end
    #==============================================================================
    # ¡ Window_MenuStatus
    #------------------------------------------------------------------------------
    #
    #==============================================================================

    class Window_RingMenuStatus < Window_Selectable
    #--------------------------------------------------------------------------
    #
    #--------------------------------------------------------------------------
    def initialize
    super(204, 64, 232, 352)
    self.contents = Bitmap.new(width - 32, height - 32)
    refresh
    self.active = false
    self.index = -1
    end
    #--------------------------------------------------------------------------
    # œ ƒŠƒtƒŒƒbƒVƒ…
    #--------------------------------------------------------------------------
    def refresh
    self.contents.clear
    self.contents.font.name = "Arial"
    @item_max = $game_party.actors.size
    for i in 0...$game_party.actors.size
    x = 80
    y = 80 * i
    actor = $game_party.actors[i]
    draw_actor_graphic(actor, x - 40, y + 80)
    draw_actor_name(actor, x, y + 24)
    end
    end
    #--------------------------------------------------------------------------
    #
    #--------------------------------------------------------------------------
    def update_cursor_rect
    if @index < 0
    self.cursor_rect.empty
    else
    self.cursor_rect.set(0, @index * 80, self.width - 32, 80)
    end
    end
    end
    #==============================================================================
    # #¡ Scene_RingMenu
    # ¡ Scene_Menu
    #------------------------------------------------------------------------------
    #
    #==============================================================================

    #class Scene_RingMenu
    class Scene_Menu
    #--------------------------------------------------------------------------
    # 
    #
    #--------------------------------------------------------------------------
    def initialize(menu_index = 0)
    @menu_index = menu_index
    end
    #--------------------------------------------------------------------------
    # 
    #--------------------------------------------------------------------------
    def main
    # ƒXƒvƒ‰ƒCƒgƒZƒbƒg‚ðì¬
    @spriteset = Spriteset_Map.new
    # ƒRƒ}ƒ“ƒhƒEƒBƒ“ƒhƒE‚ðì¬
    px = $game_player.screen_x - 15
    py = $game_player.screen_y - 24
    @command_window = Window_RingMenu.new(px,py)
    @command_window.index = @menu_index
    # ƒp[ƒeƒBl”‚ª 0 l‚̏ꍇ
    if $game_party.actors.size == 0
    # ƒAƒCƒeƒ€AƒXƒLƒ‹A‘•”õAƒXƒe[ƒ^ƒX‚𖳌ø‰»
    @command_window.disable_item(0)
    @command_window.disable_item(1)
    @command_window.disable_item(2)
    @command_window.disable_item(3)
    end
    @command_window.z = 100
    # ƒZ[ƒu‹ÖŽ~‚̏ꍇ
    if $game_system.save_disabled
    # ƒZ[ƒu‚𖳌ø‚É‚·‚é
    @command_window.disable_item(4)
    end
    # ƒXƒe[ƒ^ƒXƒEƒBƒ“ƒhƒE‚ðì¬
    @status_window = Window_RingMenuStatus.new
    @status_window.x = 160
    @status_window.y = 0
    @status_window.z = 200
    @status_window.visible = false
    # ƒgƒ‰ƒ“ƒWƒVƒ‡ƒ“ŽÀs
    Graphics.transition
    # ƒƒCƒ“ƒ‹[ƒv
    loop do
    # ƒQ[ƒ€‰æ–Ê‚ðXV
    Graphics.update
    # “ü—͏î•ñ‚ðXV
    Input.update
    # ƒtƒŒ[ƒ€XV
    update
    # ‰æ–Ê‚ªØ‚è‘Ö‚í‚Á‚½‚烋[ƒv‚ð’†’f
    if $scene != self
    break
    end
    end
    # ƒgƒ‰ƒ“ƒWƒVƒ‡ƒ“€”õ
    Graphics.freeze
    # ƒXƒvƒ‰ƒCƒgƒZƒbƒg‚ð‰ð•ú
    @spriteset.dispose
    # ƒEƒBƒ“ƒhƒE‚ð‰ð•ú
    @command_window.dispose
    @status_window.dispose
    end
    #--------------------------------------------------------------------------
    # œ ƒtƒŒ[ƒ€XV
    #--------------------------------------------------------------------------
    def update
    # ƒEƒBƒ“ƒhƒE‚ðXV
    @command_window.update
    @status_window.update
    # ƒRƒ}ƒ“ƒhƒEƒBƒ“ƒhƒE‚ªƒAƒNƒeƒBƒu‚̏ꍇ: update_command ‚ðŒÄ‚Ô
    if @command_window.active
    update_command
    return
    end
    # ƒXƒe[ƒ^ƒXƒEƒBƒ“ƒhƒE‚ªƒAƒNƒeƒBƒu‚̏ꍇ: update_status ‚ðŒÄ‚Ô
    if @status_window.active
    update_status
    return
    end
    end
    #--------------------------------------------------------------------------
    # œ ƒtƒŒ[ƒ€XV (ƒRƒ}ƒ“ƒhƒEƒBƒ“ƒhƒE‚ªƒAƒNƒeƒBƒu‚̏ꍇ)
    #--------------------------------------------------------------------------
    def update_command
    # B ƒ{ƒ^ƒ“‚ª‰Ÿ‚³‚ꂽê‡
    if Input.trigger?(Input::B)
    # ƒLƒƒƒ“ƒZƒ‹ SE ‚ð‰‰‘t
    $game_system.se_play($data_system.cancel_se)
    # ƒ}ƒbƒv‰æ–ʂɐ؂è‘Ö‚¦
    $scene = Scene_Map.new
    return
    end
    # C ƒ{ƒ^ƒ“‚ª‰Ÿ‚³‚ꂽê‡
    if Input.trigger?(Input::C)
    # si touche c presse
    if $game_party.actors.size == 0 and @command_window.index < 4
    #
    $game_system.se_play($data_system.buzzer_se)
    return
    end
    # ƒRƒ}ƒ“ƒhƒEƒBƒ“ƒhƒE‚̃J[ƒ\ƒ‹ˆÊ’u‚Å•ªŠò
    case @command_window.index
    when 0 # ƒAƒCƒeƒ€
    # Œˆ’è SE ‚ð‰‰‘t
    $game_system.se_play($data_system.decision_se)
    # ƒAƒCƒeƒ€‰æ–ʂɐ؂è‘Ö‚¦
    $scene = Scene_Item.new
    when 1 # ƒXƒLƒ‹
    # Œˆ’è SE ‚ð‰‰‘t
    $game_system.se_play($data_system.decision_se)
    # ƒXƒe[ƒ^ƒXƒEƒBƒ“ƒhƒE‚ðƒAƒNƒeƒBƒu‚É‚·‚é
    @command_window.active = false
    @status_window.active = true
    @status_window.visible = true
    @status_window.index = 0
    when 2 # ‘•”õ
    # Œˆ’è SE ‚ð‰‰‘t
    $game_system.se_play($data_system.decision_se)
    # ƒXƒe[ƒ^ƒXƒEƒBƒ“ƒhƒE‚ðƒAƒNƒeƒBƒu‚É‚·‚é
    @command_window.active = false
    @status_window.active = true
    @status_window.visible = true
    @status_window.index = 0
    when 3 # ƒXƒe[ƒ^ƒX
    # Œˆ’è SE ‚ð‰‰‘t
    $game_system.se_play($data_system.decision_se)
    # ƒXƒe[ƒ^ƒXƒEƒBƒ“ƒhƒE‚ðƒAƒNƒeƒBƒu‚É‚·‚é
    @command_window.active = false
    @status_window.active = true
    @status_window.visible = true
    @status_window.index = 0
    when 4 # ƒZ[ƒu
    # ƒZ[ƒu‹ÖŽ~‚̏ꍇ
    if $game_system.save_disabled
    # ƒuƒU[ SE ‚ð‰‰‘t
    $game_system.se_play($data_system.buzzer_se)
    return
    end
    # Œˆ’è SE ‚ð‰‰‘t
    $game_system.se_play($data_system.decision_se)
    # ƒZ[ƒu‰æ–ʂɐ؂è‘Ö‚¦
    $scene = Scene_Save.new
    when 5 # ƒQ[ƒ€I—¹
    # Œˆ’è SE ‚ð‰‰‘t
    $game_system.se_play($data_system.decision_se)
    # ƒQ[ƒ€I—¹‰æ–ʂɐ؂è‘Ö‚¦
    $scene = Scene_End.new
    end
    return
    end
    # ƒAƒjƒ[ƒVƒ‡ƒ“’†‚È‚çƒJ[ƒ\ƒ‹‚̏ˆ—‚ðs‚í‚È‚¢
    return if @command_window.animation?
    # ªor©️ ƒ{ƒ^ƒ“‚ª‰Ÿ‚³‚ꂽê‡
    if Input.press?(Input::UP) or Input.press?(Input::LEFT)
    $game_system.se_play($data_system.cursor_se)
    @command_window.setup_move_move(Window_RingMenu::MODE_MOVEL)
    return
    end
    # «or¨ ƒ{ƒ^ƒ“‚ª‰Ÿ‚³‚ꂽê‡
    if Input.press?(Input::DOWN) or Input.press?(Input::RIGHT)
    $game_system.se_play($data_system.cursor_se)
    @command_window.setup_move_move(Window_RingMenu::MODE_MOVER)
    return
    end
    end
    #--------------------------------------------------------------------------
    # œ ƒtƒŒ[ƒ€XV (ƒXƒe[ƒ^ƒXƒEƒBƒ“ƒhƒE‚ªƒAƒNƒeƒBƒu‚̏ꍇ)
    #--------------------------------------------------------------------------
    def update_status
    # B ƒ{ƒ^ƒ“‚ª‰Ÿ‚³‚ꂽê‡
    if Input.trigger?(Input::B)
    # ƒLƒƒƒ“ƒZƒ‹ SE ‚ð‰‰‘t
    $game_system.se_play($data_system.cancel_se)
    # ƒRƒ}ƒ“ƒhƒEƒBƒ“ƒhƒE‚ðƒAƒNƒeƒBƒu‚É‚·‚é
    @command_window.active = true
    @status_window.active = false
    @status_window.visible = false
    @status_window.index = -1
    return
    end
    # C ƒ{ƒ^ƒ“‚ª‰Ÿ‚³‚ꂽê‡
    if Input.trigger?(Input::C)
    # ƒRƒ}ƒ“ƒhƒEƒBƒ“ƒhƒE‚̃J[ƒ\ƒ‹ˆÊ’u‚Å•ªŠò
    case @command_window.index
    when 1 # ƒXƒLƒ‹
    # ‚±‚̃AƒNƒ^[‚̍s“®️§ŒÀ‚ª 2 ˆÈã‚̏ꍇ
    if $game_party.actors[@status_window.index].restriction >= 2
    # ƒuƒU[ SE ‚ð‰‰‘t
    $game_system.se_play($data_system.buzzer_se)
    return
    end
    # Œˆ’è SE ‚ð‰‰‘t
    $game_system.se_play($data_system.decision_se)
    # ƒXƒLƒ‹‰æ–ʂɐ؂è‘Ö‚¦
    $scene = Scene_Skill.new(@status_window.index)
    when 2 # ‘•”õ
    # Œˆ’è SE ‚ð‰‰‘t
    $game_system.se_play($data_system.decision_se)
    # ‘•”õ‰æ–ʂɐ؂è‘Ö‚¦
    $scene = Scene_Equip.new(@status_window.index)
    when 3 # ƒXƒe[ƒ^ƒX
    # Œˆ’è SE ‚ð‰‰‘t
    $game_system.se_play($data_system.decision_se)
    # ƒXƒe[ƒ^ƒX‰æ–ʂɐ؂è‘Ö‚¦
    $scene = Scene_Status.new(@status_window.index)
    end
    return
    end
    end
    end


    Dernière édition par louckas le Mar 27 Avr - 21:38, édité 2 fois (Raison : bug rectifier)
    Galtrak
    Galtrak
    Admin
    Admin


    Messages : 192
    Réputation : 31
    Date d'inscription : 13/04/2010
    Localisation : Derrière mon écran

    menu tournant Empty Re: menu tournant

    Message  Galtrak Mar 27 Avr - 16:08

    +1 Wink
    louckas
    louckas
    modérateur
    modérateur


    Messages : 116
    Réputation : 11
    Date d'inscription : 17/04/2010

    menu tournant Empty Re: menu tournant

    Message  louckas Mar 27 Avr - 21:27

    pour tout ceux qui cherchent a comprendre le code ne lisez pas se qui a derrier le #ce sont des comentaire que je vais modifier au fur et a mesure pour vous
    avatar
    adzop
    Animateurs
    Animateurs


    Messages : 24
    Réputation : 3
    Date d'inscription : 14/04/2010

    menu tournant Empty Re: menu tournant

    Message  adzop Jeu 29 Avr - 18:38

    Ouah j'adore ça marche en plus Razz
    Galtrak
    Galtrak
    Admin
    Admin


    Messages : 192
    Réputation : 31
    Date d'inscription : 13/04/2010
    Localisation : Derrière mon écran

    menu tournant Empty Re: menu tournant

    Message  Galtrak Jeu 29 Avr - 18:41

    adzop a écrit:Ouah j'adore ça marche en plus Razz
    Heureusement^^
    louckas
    louckas
    modérateur
    modérateur


    Messages : 116
    Réputation : 11
    Date d'inscription : 17/04/2010

    menu tournant Empty Re: menu tournant

    Message  louckas Jeu 29 Avr - 21:01

    je l'ai débugger alors heureusement que sa marche sinon je ne l'aurai pas mit

    Contenu sponsorisé


    menu tournant Empty Re: menu tournant

    Message  Contenu sponsorisé


      La date/heure actuelle est Dim 19 Mai - 14:27