RPG maker VX


Unirse al foro, es rápido y fácil

RPG maker VX
RPG maker VX
¿Quieres reaccionar a este mensaje? Regístrate en el foro con unos pocos clics o inicia sesión para continuar.
Últimos temas
» Script de menu
por maxi Jue 04 Dic 2014, 1:44 pm

» Ayuda intro animado!!!
por maxi Miér 03 Dic 2014, 9:41 pm

» ayuda con este engin
por maxi Miér 03 Dic 2014, 8:42 am

» Hud de Vida 100% Personalizable - Engine Sencillo! Sin Scripts :)
por davidaikago Jue 20 Nov 2014, 10:58 am

» Ultimate parallax control by:GDS [ace]
por arellano Miér 08 Oct 2014, 8:28 pm

» Script Touhou (animated) Map name (v1.4)
por davidaikago Miér 08 Oct 2014, 2:09 pm

» tutorial puerta nueva
por davidaikago Miér 08 Oct 2014, 9:08 am

» cámara de fotos
por davidaikago Miér 08 Oct 2014, 9:05 am

» Imperial Action System II Demo
por davidaikago Miér 08 Oct 2014, 8:47 am

» VE Batalla animada [ACE]
por FhierusIV Jue 18 Sep 2014, 10:57 am

» Nuevo Reglamento del Foro [Vigente desde Septiembre 2014]
por maxi Miér 17 Sep 2014, 8:37 am

» MOG|Animated Title
por Souta21 Mar 09 Sep 2014, 7:24 pm

» Tutorial Engine - Cambiar Character al Equipar Objeto
por maxi Lun 21 Jul 2014, 10:19 am

» Script de climas
por gambasoxd Sáb 19 Jul 2014, 8:58 am

» Script de contraseña(codigo) para abrir un cofre
por rpgame Jue 03 Jul 2014, 6:03 pm

¿Quién está en línea?
En total hay 2 usuarios en línea: 0 Registrados, 0 Ocultos y 2 Invitados

Ninguno

[ Ver toda la lista ]


El record de usuarios en línea fue de 117 durante el Mar 09 Ago 2011, 3:39 pm

Mouse System Buttons 1.1 en Español

2 participantes

Ir abajo

RPG Maker Vx Ace Mouse System Buttons 1.1 en Español

Mensaje por bryan_onilink Lun 15 Oct 2012, 12:34 am

Hola, deseguro no me conocen por que no aporto mucho a la comunidad, hoy les traigo el Mouse System Buttons 1.1 de Falcao, pero traducido a español.
Quisas muchos ya lo saben, pero el Mouse System Buttons 1.1 nos permite utilizar el Mouse de nuestra PC o Netbook en el juego.
Otras caracteristicas aparte:
- Permite crear y configurar los botones.
- Los eventos pueden ser demasiados botones, botones de mapa de tierra! para algunos puzzles,etc...
- Les permite mostrar el nombre del evento
- Interacción completa con el Mouse
- Movimiento WASD (opcional)
- Y la palabra que todo el mundo ama, plug and play!

Este Script fue creado por Falcao, haci que todo los agradecimientos son para el.

Bueno ahora el Script:

Código:
#==============================================================================#
#  #*****************#                                                        #
#  #*** By Falcao ***#        Mouse System Buttons 1.1                        #
#  #*****************#        Este es un script basado en el botón del Mouse,  #
#                            permite crear tantos botones que desee en la    #
#                            pantalla del mapa o del Tileset, también le      #
#                            proporciona interacción total del Mouse dentro  #
#      RMVXACE                del juego.                                      #
# makerpalace.forumotion.com  Fecha de creación: 04 de agosto de 2012          #
#          y                                                                  #
# http://www.rpgmkrvx.com/    Traducción: 15 de Octubre de 2012                #
#==============================================================================#

#---------------------------------------------------------------------------
# * Características principales
#
# - Permite crear y configurar los botones.
# - Los eventos pueden ser demasiados botones, botones de mapa de tierra!
#  para algunos puzzles,etc...
# - Le permiten mostrar el nombre del evento
# - Interacción completa con el Mouse
# - Movimiento WASD (opcional)
# - Y la palabra que ama todo el mundo, plug and play!
#---------------------------------------------------------------------------

module Map_Buttons

# Usted puede insertar tantos botones que desee en la pantalla del mapa
# definen a continuación los parámetros de botones
 
  Insert = {
#-----------------------------------------------------------------------------
#  A => [B, C, D, E, F]
#
#  A = Numero de Boton
#
#  B = Nombre
#  C = Posicion X en la Pantalla
#  D = Posicion Y en la Pantalla
#  E = Icono, si quieres utilizar una imagen, escribelo de la siguiente manera.
#  Por Ejemplo:
#  1=> ["Menu", 16, 10, "Icon_Menu", Scene_Menu],
#  Cambia el "Icon_Menu" por un nombre de una imagen que tengas dentro de la carpeta
#  Pictures, y si quieres usar un icono, selecciona el número del indice del Icono.
#  F = ¿Qué vas a hacer este botón?,
#  Tienes dos opciones: llama a la escena o llama al evento común,
#  Si desea llamar a la escena,poner el nombre de escena,
#  Si desea llamar al evento común poner el ID del evento común.
 
  # This button call the menu screen
  1=> ["Menu", 16, 10, 227, Scene_Menu],
 
 

  }
#-----------------------------------------------------------------------------
# * Botones de comandos del evento
#
# Escribir estas líneas en la página del evento por el comando comentario
#
# CLICK START    - Evento inicia cuando se haga clic en el evento
# ANIMATION +id  - Mostrar animación cuando el ratón está sobre eventos, por ejemplo: ANIMATION 1
# NAME +name    - Mostrar nombre del evento cuando el ratón está sobre eventos, por ejemplo: NAME Falcao
#
#-----------------------------------------------------------------------------
#
# * Configuración General

# Icono del cursor del Raton, si quieres una imagen haz lo mismo que al elegir el icono del Boton,
# pero, si quieres un icono, elige el número del indice del icono.
  CursorIcon = 389

# Cambie ID para activar / desactivar los iconos de la pantalla.
  Switch = 100
 
# true = Permite el movimiento con las teclas W A S D
# false = Desactiva el movimiento con las teclas W A S D
  WASD_Movement = true
 
# * Comandos
#
# Llame a esta línea para activar ó desactivar el cursor del ratón en el juego true / false
# Mouse.show_cursor(false)
#
#----------------------------------------------------------------------------
#
# * Licencia
#
# Puede utilizar esta secuencia de comandos en los juegos no comerciales,
# si lo necesita para juegos comerciales, hágamelo saber. [Tienes que estar registrado y conectado para ver este vínculo]
#-----------------------------------------------------------------------------

  def self.check_value(value)
    return 'numeric' if value.is_a? Fixnum
    return 'string'
  end
end

# Esta clase crea toda la pantalla y los botones de eventos en el mapa del juego.
class Interactive_Buttoms
  def initialize
    create_screen_buttoms
    @ani_delay = 0
  end
 
  def create_screen_buttoms
    @buttons_sprites = []
    for i in Map_Buttons::Insert.values
      @buttons_sprites.push(Sprite_Buttons.new(i[0], i[1], i[2], i[3], i[4]))
    end
  end
 
  def create_button_text
    if @button_text.nil?
      @button_text = Sprite.new
      @button_text.bitmap = Bitmap.new(100, 32)
      @button_text.z = 50
      @button_text.bitmap.font.name = "Georgia"
      @button_text.bitmap.font.size = 14
    end
  end
 
  def dispose_screen_buttons
    for button in @buttons_sprites
      button.dispose
    end
    @buttons_sprites = []
  end
 
  def dispose_button_text
    if not @button_text.nil?
      @button_text.dispose
      @button_text.bitmap.dispose
      @button_text = nil
    end
  end
 
  def dispose
    dispose_screen_buttons
    dispose_button_text
  end
 
  def update
    if $game_switches[Map_Buttons::Switch] and not @buttons_sprites.empty?
      dispose_screen_buttons
    elsif not $game_switches[Map_Buttons::Switch] and @buttons_sprites.empty?
      create_screen_buttoms
    end
    update_buttons
    update_event_selection
  end
 
  def update_buttons
    for button in @buttons_sprites
      button.update
      if button.zooming
        @screen_b = true
        create_button_text
        if button.x > 272
          x, y = button.px * 32 - 98, button.py * 32
          draw_button_text(x, y, button.name, 2)
        elsif button.x < 272
          x, y = button.px * 32 + 31, button.py * 32
          draw_button_text(x, y, button.name, 0)
        end
      end
    end
 
    if @screen_b != nil
      unless mouse_over_button?
        dispose_button_text
        @screen_b = nil
      end
    end
  end
 
  def update_event_selection
    return if @screen_b # Desactivar el botón de evento si el ratón no esta sobre el botón en la pantalla.
    for event in $game_map.events.values
      if event.x ==  Mouse.map_grid[0] and event.y == Mouse.map_grid[1]
        if event.check_comment("CLICK START")
          if Mouse.trigger?(0) and !$game_map.interpreter.running?
            event.start
          end
        end
        anime = event.check_value("ANIMATION")
        if anime != 0
          @ani_delay += 1
          event.animation_id = anime if @ani_delay == 1
          @ani_delay = 0 if @ani_delay > 16
        end
        name = event.check_name("NAME")
        if name != ""
          @eve = [event.x, event.y, event, name]
          create_button_text
        end
      end
    end
 
    if @eve != nil
      if @eve[2].ch_oy > 32
        draw_button_text(@eve[2].screen_x - 49,
        @eve[2].screen_y - @eve[2].ch_oy / 2 - 50, @eve[3], 1)
      else
        draw_button_text(@eve[2].screen_x - 49,
        @eve[2].screen_y - @eve[2].ch_oy / 2 - 36, @eve[3], 1)
      end
      if not mouse_over_event?(@eve[0], @eve[1])
        dispose_button_text
        @eve = nil
      end
    end
  end
 
  def draw_button_text(x, y, text, a=0)
    return if @button_text.nil?
    @button_text.x = x
    @button_text.y = y
    return if @old_name == text
    @button_text.bitmap.clear
    @button_text.bitmap.draw_text(2, 0, @button_text.bitmap.width, 32, text, a)
    @old_name = text
  end
 
  def mouse_over_button?
    for button in @buttons_sprites
      if Mouse.object_area?(button.x, button.y - 6, button.width, button.height)
        return true
      end
    end
    @old_name = nil
    return false
  end
 
  def mouse_over_event?(event_x, event_y)
    if Mouse.map_grid[0] == event_x and Mouse.map_grid[1] == event_y
      return true
    end
    @old_name = nil
    return false
  end
end

# Definición de botones de los sprites
class Spriteset_Map
  alias falcao_insert_buttuns_view create_viewports
  def create_viewports
    @interact_buttoms = Interactive_Buttoms.new
    falcao_insert_buttuns_view
  end
 
  alias falcao_insert_buttuns_dis dispose
  def dispose
    @interact_buttoms.dispose
    falcao_insert_buttuns_dis
  end
 
  alias falcao_insert_buttuns_up update
  def update
    @interact_buttoms.update
    falcao_insert_buttuns_up
  end
end

# Definición de los comentarios
class Game_Event < Game_Character
  def check_comment(comment)
    return false if @list.nil? or @list.size <= 0
    for item in @list
      if item.code == 108 or item.code == 408
        if item.parameters[0].include?(comment)
          return true
        end
      end
    end
    return false
  end
 
  def check_value(comment)
    return 0 if @list.nil? or @list.size <= 0
    for item in @list
      if item.code == 108 or item.code == 408
        if item.parameters[0] =~ /#{comment}[ ]?(\d+)?/
          return $1.to_i
        end
      end
    end
    return 0
  end
 
  def check_name(comment)
    return "" if @list.nil? or @list.size <= 0
    for item in @list
      next unless item.code == 108 or item.code == 408
      if item.parameters[0] =~ /#{comment} (.*)/
        return $1.to_s
      end
    end
    return ""
  end
end

# Crear sprites de los botones de la pantalla.
class Sprite_Buttons < Sprite
  attr_reader  :px
  attr_reader  :py
  attr_reader  :name
  attr_reader  :zooming
  def initialize(name, px, py, icon_index, action=nil)
    super()
    self.z = 50
    @icon_index = icon_index
    @px = px
    @py = py
    @action = action
    @object_zooming = 0
    @zooming = false
    @name = name
    set_bitmap
    update
  end
 
  def update
    super
    if Mouse.object_area?(self.x, self.y - 4, self.bitmap.width,
      self.bitmap.height)
      @zooming = true
      @object_zooming += 1
      case @object_zooming
      when 1..10  ; self.zoom_x -= 0.02 ;  self.zoom_y -= 0.02
      when 11..20 ; self.zoom_x += 0.02 ;  self.zoom_y += 0.02
      when 21..30 ; self.zoom_x = 1.0  ;  self.zoom_y = 1.0
        @object_zooming = 0
      end
      if Mouse.trigger?(0) and @action != nil
        unless $game_map.interpreter.running?
          Sound.play_ok
          if @action == Scene_Menu and not $game_system.menu_disabled
            SceneManager.call(@action)
            Window_MenuCommand::init_command_position
            return
          end
        if Map_Buttons::check_value(@action) == 'numeric'
          $game_temp.reserve_common_event(@action)
        else
          SceneManager.call(@action)
        end
        end
      end
    elsif @object_zooming > 0
      self.zoom_x = 1.0
      self.zoom_y = 1.0
      @object_zooming = 0
    else
      @zooming = false
    end
  end
 
  def set_bitmap
    if Map_Buttons::check_value(@icon_index) == 'numeric'
      self.bitmap = Bitmap.new(24, 24)
      bitmap = Cache.system("Iconset")
      rect = Rect.new(@icon_index % 16 * 24, @icon_index / 16 * 24, 24, 24)
      self.bitmap.blt(0, 0, bitmap, rect)
    else
      self.bitmap = Cache.picture(@icon_index)
    end
    self.x = @px * 32 + 4
    self.y = @py * 32 + 4
  end
end

# Game_character nueva variable
class Game_CharacterBase
  attr_accessor :ch_oy
end

# Sprite del personaje
class Sprite_Character < Sprite_Base
  alias falcaoadd_oxy_set_character_bitmap set_character_bitmap
  def set_character_bitmap
    falcaoadd_oxy_set_character_bitmap
    @character.ch_oy = self.oy
  end
end

# Modulo del Mouse
module Mouse
 
  GetKeyState    = Win32API.new('user32',    'GetAsyncKeyState', 'i',    'i')
  GetCursorPos  = Win32API.new('user32',    'GetCursorPos',    'p',    'i')
  GetClientRect  = Win32API.new('user32',    'GetClientRect',    %w(l p), 'i')
  ShowCursor    = Win32API.new('user32',    'ShowCursor',      'i',    'l')
  ScreenToClient = Win32API.new('user32',    'ScreenToClient',  %w(l p), 'i')
  Findwindow    = Win32API.new('user32',    'FindWindowA',      %w(p p), 'l')
  GetPrivatePro  = Win32API.new('kernel32',  'GetPrivateProfileStringA',
  %w(p p p p l p), 'l')
                           
  ShowCursor.call(0)
 
  @triggers    =  [[0, 1], [0, 2], [0, 4]]
  @old_pos      =  0

  # Sprite del Mouse
  $mouse_cursor = Sprite.new
  icon = Map_Buttons::CursorIcon
  if Map_Buttons::check_value(icon) == 'numeric'
    $mouse_cursor.bitmap = Bitmap.new(24, 24)
    bitmap = Cache.system("Iconset")
    rect = Rect.new(icon % 16 * 24, icon / 16 * 24, 24, 24)
    $mouse_cursor.bitmap.blt(0, 0, bitmap, rect)
  else
    $mouse_cursor.bitmap = Cache.picture(icon)
  end
  $mouse_cursor.z = 10001
  $mouse_cursor.x = $mouse_cursor.y = 1000
  $mouse_cursor.ox = 4
 
  def self.show_cursor(value)
    unless value
      @pos[0] = @pos[1] = 600
    end
    $mouse_cursor.visible = value
  end
 
  def self.map_grid
    return nil if @pos == nil
    x = ($game_map.display_x).truncate + (@pos[0] / 32)
    y = ($game_map.display_y).truncate + (@pos[1] / 32)
    return [x, y]
  end
 
  def self.standing?
    return false if @old_px != @pos[0] or @old_py != @pos[1]
    return true
  end
 
  def self.input_keys
    $game_arrows.mode_on ? type = $game_arrows.in_type : type = Input::C
    keys = {0 => type, 1 => Input::B, 2 => Input::A}
    return keys
  end
 
  def self.object_area?(x, y, width, height)
    return false if @pos.nil?
    return @pos[0].between?(x, width + x) && @pos[1].between?(y, height + y)
  end
 
  def self.position
    return @pos == nil ? [0, 0] : @pos
  end
 
  def self.global_pos
    pos = [0, 0].pack('ll')
    return GetCursorPos.call(pos) == 0 ? nil : pos.unpack('ll')
  end
 
  def self.screen_to_client(x=0, y=0)
    pos = [x, y].pack('ll')
    return ScreenToClient.call(self.hwnd, pos) == 0 ? nil : pos.unpack('ll')
  end
 
  def self.pos
    global_pos = [0, 0].pack('ll') 
    gx, gy = GetCursorPos.call(global_pos) == 0 ? nil : global_pos.unpack('ll')
    local_pos = [gx, gy].pack('ll')
    x, y = ScreenToClient.call(self.hwnd,
    local_pos) == 0 ? nil : local_pos.unpack('ll')
    begin
      if (x >= 0 && y >= 0 && x <= 544 && y <= 416)
        @old_px, @old_py = x, y
        return x, y
      else
        return -20, -20
      end
    rescue
      return 0, 0
    end
  end
 
  def self.update
    old_pos = @pos
    @pos = self.pos
    self.input_keys
    if !$mouse_cursor.visible && old_pos != @pos
      $mouse_cursor.visible = true
    end
    if old_pos != [-20, -20] && @pos == [-20, -20]
      ShowCursor.call(1)
    elsif old_pos == [-20, -20] && @pos != [-20, -20]
      ShowCursor.call(0)
    end
    for i in @triggers
      n = GetKeyState.call(i[1])
      if [0, 1].include?(n)
        i[0] = (i[0] > 0 ? i[0] * -1 : 0)
      else
        i[0] = (i[0] > 0 ? i[0] + 1 : 1)
      end
    end
  end
 
  # definición de trigger
  def self.trigger?(id = 0)
    pos = self.pos
    if pos != [-20,-20]
    case id
      when 0
        return @triggers[id][0] == 1
      when 1
        if @triggers[1][0] == 1 && !$game_system.menu_disabled
          return @triggers[id][0] == 1
        end
      when 2
        return @triggers[id][0] == 1
      end 
    end
  end
 
  # Repetir definición
  def self.repeat?(id = 0)
    if @triggers[id][0] <= 0
      return false
    else
      return @triggers[id][0] % 5 == 1 && @triggers[id][0] % 5 != 2
    end
  end
 
  # Pulsar definición
  def self.press?(id = 0)
    if @triggers[id][0] <= 0
      return false
    else
      return true
    end
  end
 
  def self.screen_to_client(x=0, y=0)
    pos = [x, y].pack('ll')
    return ScreenToClient.call(self.hwnd, pos) == 0 ? nil : pos.unpack('ll')
  end
 
  def self.hwnd
    if @hwnd.nil?
      game_name = "\0" * 256
      GetPrivatePro.call('Game', 'Title', '', game_name, 255, ".\\Game.ini")
      game_name.delete!("\0")
      @hwnd = Findwindow.call('RGSS Player', game_name)
    end
    return @hwnd
  end
 
  def self.client_size
    rect = [0, 0, 0, 0].pack('l4')
    GetClientRect.call(self.hwnd, rect)
    right, bottom = rect.unpack('l4')[2..3]
    return right, bottom
  end
end

# Módulo de entrada de alias
class << Input
  unless self.method_defined?(:falcao21_mouse_update)
    alias_method :falcao21_mouse_update,  :update
    alias_method :falcao21_mouse_trigger?, :trigger?
    alias_method :falcao21_mouse_repeat?,  :repeat?
    alias_method :fal_mouse_input_press?,  :press?
  end
 
  def update
    if $mouse_cursor.visible
      Mouse.update
      $game_arrows.update
      mx, my = *Mouse.position
      $mouse_cursor.x = mx unless mx.nil?
      $mouse_cursor.y = my unless my.nil? 
    end
    falcao21_mouse_update
  end
 
  # trigger
  def trigger?(constant)
    return true if falcao21_mouse_trigger?(constant)
    unless Mouse.pos.nil?
      if Mouse.input_keys.has_value?(constant)
        mouse_trigger = Mouse.input_keys.index(constant)
        return true if Mouse.trigger?(mouse_trigger)
      end
    end
    return false
  end
 
  # Pulsar
  def press?(constant)
    return true if fal_mouse_input_press?(constant)
    unless Mouse.pos.nil?
      if Mouse.input_keys.has_value?(constant)
        mouse_trigger = Mouse.input_keys.index(constant)
        return true if Mouse.press?(mouse_trigger)   
      end
    end
    return false
  end
 
  # Repetir
  def repeat?(constant)
    return true if falcao21_mouse_repeat?(constant)
    unless Mouse.pos.nil?
      if Mouse.input_keys.has_value?(constant)
        mouse_trigger = Mouse.input_keys.index(constant) 
        return true if Mouse.repeat?(mouse_trigger)
      end
    end
    return false
  end
end

# Aquí tu mejor amigo, puede llamar a este script dentro del juego, escena,etc...
# game_arrows.create_arrows $ (x, y), créelo, $ game_arrows.dispose, eliminarla
class Game_Arrow_Selector
  attr_accessor :mode_on
  attr_accessor :in_type
  def initialize
    @mode_on = false
  end

  def create_arrows(x, y)
    return unless @arrows_sprites.nil?
    buttons = {1=> 'UP', 2=> 'RIGHT', 3=> 'DOWN',
    4=> 'LEFT', 5=> 'OK', 6=> 'Cancel'}
    @arrows_sprites = []
    for i in buttons.values
      @arrows_sprites.push(Garrows_Sprites.new(i, x, y))
    end
  end
 
  def dispose
    return if @arrows_sprites.nil?
    for arrow in @arrows_sprites
      arrow.dispose
    end
    @arrows_sprites = nil
    @mode_on = false
  end
 
  def update
    return if @arrows_sprites.nil?
    for arrow in @arrows_sprites
      arrow.update
    end
  end
end

class Garrows_Sprites < Sprite
  def initialize(name, x, y)
    super()
    self.z = 1000
    @px, @py = x, y
    @name = name
    @object_zooming = 0
    @zooming = false
    set_bitmap
    update
  end
 
  def update
    super
    if Mouse.object_area?(self.x + @fix[0], self.y + @fix[1],
      self.bitmap.width + @fix[2], self.bitmap.height + @fix[3])
      $game_arrows.mode_on = true
      $game_arrows.in_type = Input::UP    if @name == 'UP'
      $game_arrows.in_type = Input::DOWN  if @name == 'DOWN'
      $game_arrows.in_type = Input::LEFT  if @name == 'LEFT'
      $game_arrows.in_type = Input::RIGHT if @name == 'RIGHT'
      $game_arrows.in_type = Input::C    if @name == 'OK'
      $game_arrows.in_type = Input::B    if @name == 'Cancel'
      @object_zooming += 1
      @zooming = true
      case @object_zooming
      when 1..10  ; self.zoom_x -= 0.01 ;  self.zoom_y -= 0.01
      when 11..20 ; self.zoom_x += 0.01 ;  self.zoom_y += 0.01
      when 21..30 ; self.zoom_x = 1.0  ;  self.zoom_y = 1.0
        @object_zooming = 0
      end
    elsif @object_zooming > 0
      self.zoom_x = 1.0
      self.zoom_y = 1.0
      @object_zooming = 0
    elsif @zooming
      @zooming = false
      $game_arrows.mode_on = false
    end
  end
 
  def set_bitmap
    self.bitmap = Bitmap.new(24, 15) if @name != 'Cancel'
    case @name
    when 'UP'
      self.x = @px + 25 ; self.y = @py - 2
      self.angle = 182  ; @fix = [-23, -18, 0,  0]
    when 'DOWN'
      self.x = @px + 1 ; self.y = @py + 26
      @fix = [0, -4, 0,  0]
    when 'LEFT'
      self.x = @px      ; self.y = @py + 1
      self.angle = - 92 ; @fix = [-14, -4, - 9,  9]
    when 'RIGHT'
      self.x = @px + 26  ; self.y = @py + 26
      self.angle = + 92  ; @fix = [0, - 26, - 9,  9]
    when 'OK'
      self.x = @px + 1  ; self.y = @py + 6
      @fix = [0, -4, 0,  0]
      self.bitmap.font.size = 20
      self.bitmap.draw_text(4, -7, self.bitmap.width, 32, @name)
      return
    when 'Cancel'
      self.x = @px - 11  ; self.y = @py + 42
      @fix = [0, -4, 0,  0]
      self.bitmap = Bitmap.new(50, 15)
      self.bitmap.font.size = 20
      self.bitmap.draw_text(2, -7, self.bitmap.width, 32, @name)
      return
    end
    draw_crappy_triangle(0, 0)
  end
 
  # Este método de crear un triángulo apuntando hacia abajo.
  def draw_crappy_triangle(px, py)
    color = Color.new(192, 224, 255, 255)
    x, y, w, =  0, 4, 24
    self.bitmap.fill_rect(px + 1, py, 22, 1, color)
    self.bitmap.fill_rect(px,    py + 1, 24, 4, color)
    for i in 1..10
      x += 1; y += 1; w -= 2
      self.bitmap.fill_rect(px + x, py + y,      w, 1, color)
    end
  end
end

$game_arrows = Game_Arrow_Selector.new

# Arrow selector se muestra cuando el número de entrada está ON.
class Game_Interpreter
  alias falcao_setup_num_input setup_num_input
  def setup_num_input(params)
    falcao_setup_num_input(params)
    $game_arrows.create_arrows(256, 194) if $game_message.position == 0
    $game_arrows.create_arrows(256, 340) if $game_message.position == 1
    $game_arrows.create_arrows(256, 180) if $game_message.position == 2
  end
end

# Arrow selector está dispuesto al pulsar OK.
class Window_NumberInput < Window_Base
  alias falcao_process_ok process_ok
  def process_ok
    falcao_process_ok
    $game_arrows.dispose
  end
end

# Arrow selector se muestra dentro de la escena Guardar y Cargar.
class Scene_File < Scene_MenuBase
  alias falcao47_start start
  alias falcao47_terminate terminate
 
  def start
    falcao47_start
    $game_arrows.create_arrows(210, 166)
  end
 
  def terminate
    falcao47_terminate
    $game_arrows.dispose
  end
end

# Movimientos WASD
module Input
  class << self
    if !method_defined?('vxe_dir4')
      alias vxace_dir4 dir4
    end
    def dir4
      if Map_Buttons::WASD_Movement
        return 2 if (Input.press?(Input::Y))
        return 4 if (Input.press?(Input::X))
        return 6 if (Input.press?(Input::Z))
        return 8 if (Input.press?(Input::R))
      end
      return vxace_dir4
    end
  end
end

# Si el evento inicio con el ratón
class Game_Player < Game_Character
  alias falcao_start_map_event start_map_event
  def start_map_event(x, y, triggers, normal)
    $game_map.events_xy(x, y).each do |event_click|
      return if event_click.check_comment("CLICK START")
    end
    falcao_start_map_event(x, y, triggers, normal)
  end
end

# Seleccionar Window (Wora Gracias por algunas líneas aquí)
class Window_Selectable < Window_Base
  alias mouse_selection_ini initialize
  def initialize(*args)
    mouse_selection_ini(*args)
    @scroll_wait = 0
    @cursor_wait = 0
  end

  alias mouse_selection_update update
  def update
    mouse_selection_update
    update_mouse_selection if self.active and self.visible
  end
 
  def update_mouse_selection
    @cursor_wait -= 1 if @cursor_wait > 0
    (0..self.item_max - 1).each do |i|
      irect = item_rect(i)
      irx = self.x + 16 + irect.x - self.ox
      iry = self.y + 16 + irect.y - self.oy
      move_cursor(i) if Mouse.object_area?(irx, iry, irect.width, irect.height)
      update_cursor
    end
  end

  def move_cursor(index)
    return if @index == index
    @scroll_wait -= 1 if @scroll_wait > 0
    row1 = @index / self.col_max
    row2 = index / self.col_max
    bottom = self.top_row + (self.page_row_max - 1)
    Sound.play_cursor if index != @index
    if row1 == self.top_row and row2 < self.top_row
      return if @scroll_wait > 0
      @index = [@index - self.col_max, 0].max
      @scroll_wait = 30
    elsif row1 == bottom and row2 > bottom
      return if @scroll_wait > 0
      @index = [@index + self.col_max, self.item_max - 1].min
      @scroll_wait = 30
    else
      @index = index
    end
    return if @cursor_wait > 0
    @cursor_wait += 2
  end
end

# Nombre de entrada seleccionable
class Window_NameInput
  alias mouse_name_select update unless $@
  def update(*args, &block)
    mouse_name_select(*args, &block)
    if self.active and self.visible
      (0..self.table[@page].size - 1).each do |i|
      irect = item_rect(i)
      irx = self.x + 16 + irect.x - self.ox
      iry = self.y + 16 + irect.y - self.oy
      @index = i if Mouse.object_area?(irx, iry, irect.width, irect.height)
      end
    end
  end
end

# Ventana de comandos del Grupo
class Window_PartyCommand < Window_Command
  def update_mouse_selection
    (0..self.item_max - 1).each do |i|
    irect = item_rect(i)
    irx = self.viewport.ox + 16 + irect.x - self.ox
    iry = 288 + 16 + irect.y - self.oy
    self.index = i if Mouse.object_area?(irx, iry, irect.width, irect.height)
    end
  end
end

# Ventana de comandos del Actor
class Window_ActorCommand < Window_Command
  def update_mouse_selection
    (0..self.item_max - 1).each do |i|
    irect = item_rect(i)
    irx = self.viewport.ox + 288 + 16 + irect.x
    iry = 288 + 16 + irect.y
    self.index = i if Mouse.object_area?(irx, iry, irect.width, irect.height)
    end
  end
end

Perdon por no aportar imagenes, pero creo que no hace falta.Espero que disfruten del Script.
bryan_onilink
bryan_onilink
30
30

Masculino

Edad 28

Cantidad de envíos 39

Maker Cash 67

Reputación 8


Extras
Sobre mí:: Imaginar, Proyectar, Crear, Editar, Publicar, esos son todos los pasos por los que pasa un creador.

Volver arriba Ir abajo

RPG Maker Vx Ace Re: Mouse System Buttons 1.1 en Español

Mensaje por luistop12 Mar 16 Oct 2012, 9:49 am

Gracias por el aporte amigo, Hace poco tube un Problemilla con mi teclado y no pude jugar,Pero ahora si eso sucede otra vez jejejejejej

Buen aporte gracias bro
luistop12
luistop12
500
500

Masculino

Edad 33

Cantidad de envíos 759

Maker Cash 944

Reputación 42


Volver arriba Ir abajo

Volver arriba

- Temas similares

 
Permisos de este foro:
No puedes responder a temas en este foro.