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 1 usuario en línea: 0 Registrados, 0 Ocultos y 1 Invitado

Ninguno

[ Ver toda la lista ]


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

[Script] Cursor Sprite + Smooth Movement

2 participantes

Ir abajo

[Script] Cursor Sprite + Smooth Movement Empty [Script] Cursor Sprite + Smooth Movement

Mensaje por Linksen Lun 22 Oct 2012, 12:25 pm


Cursor Sprite + Smooth Movement Script


# Author : strcat
# Version : 1.2
# Date : 29 / 01 / 2008



# This script will create a new cursor sprite,and add a smooth movement to
# the cursor,thus making your game look better

-Instrucciones-:


Pegar encima de Main.
Colocar la imagen del final en "System"


-Script-:
Código:

#==============================================================================
# Cursor Sprite + Smooth Movement Script
#==============================================================================
# Author  : strcat
# Version : 1.2
# Date    : 29 / 01 / 2008
#------------------------------------------------------------------------------
# This script will create a new cursor sprite,and add a smooth movement to
# the cursor,thus making your game look better
#------------------------------------------------------------------------------
#==============================================================================
# ** STRRGSS2
#==============================================================================
module STRRGSS2
  # Cursor graphic file name
  WCURSOR_FN = "Window_cursor"
  # position of the cursor(x, y)
  WCURSOR_X = 0
  WCURSOR_Y = 0
end
class Sprite_WindowCursor < Sprite
  WAIT = 8    # numbers of frame for cursor update delay.
  CW  = 24  # cursor width
  CH  = 24  # cursor height
end
#==============================================================================
# ** Window_Selectable
#==============================================================================
class Window_Selectable < Window_Base
  #--------------------------------------------------------------------------
  #  * Update Cursor
  #--------------------------------------------------------------------------
  def update_se_cursor
    cr = self.cursor_rect
    r = Rect.new(0, 0, 0, 0)
    y = (self.cursor_rect.height - 24) / 2
    v = nil
    v = self.viewport if self.viewport != nil
    @strcursor.viewport = v
    @strcursor.x = self.x + 16 + cr.x - 24 + STRRGSS2::WCURSOR_X
    @strcursor.y = self.y + 16 + cr.y + y  + STRRGSS2::WCURSOR_Y
    @strcursor.z = self.z + 16
    @strcursor.opacity += 64
    @strcursor.opacity = self.opacity if @strcursor.opacity > self.opacity
    @strcursor.visible = ((cr != r) and self.openness == 255)
    @strcursor.visible = false unless self.visible
    @strcursor.blink = (not self.active)
    @strcursor.update
  end
  def update_cursor_str(r,rect)
    self.cursor_rect = r
    rect = Rect.new(0, 0, 0, 0) if @index < 0
    mx = self.cursor_rect.x - rect.x
    if mx >= -1 and mx <= 1
      self.cursor_rect.x = rect.x
    elsif mx != 0
      x = self.cursor_rect.x - (mx/2.0)
      self.cursor_rect.x = x
    end
    my = self.cursor_rect.y - rect.y
    if my >= -1 and my <= 1
      self.cursor_rect.y = rect.y
    elsif my != 0
      y = self.cursor_rect.y - (my/2.0)
      self.cursor_rect.y = y
    end
    self.cursor_rect.width = rect.width
    self.cursor_rect.height = rect.height
  end
  def visible=(v)
    super
    @strcursor.visible = v
  end
  def active=(v)
    super
    @strcursor.visible = false
  end
  def dispose
    @strcursor.dispose
    super
  end
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  alias initialize_str05m initialize
  def initialize(x, y, width, height, spacing = 32)
    initialize_str05m(x, y, width, height, spacing)
    file = STRRGSS2::WCURSOR_FN
    v = nil
    v = self.viewport if self.viewport != nil
    @strcursor = Sprite_WindowCursor.new(file, v)
    @f_set = false
  end
  alias update_str05m update
  def update
    update_se_cursor unless @opening
    update_str05m
  end
  alias update_cursor_str05m update_cursor
  def update_cursor
    r = self.cursor_rect.clone unless @f_set
    update_cursor_str05m
    update_cursor_str(r, self.cursor_rect.clone) unless @f_set
    @f_set = false
  end
  #--------------------------------------------------------------------------
  # * Get Index
  #--------------------------------------------------------------------------
  def index=(index)
    @f_set = true
    @index = index
    update_cursor
    call_update_help
  end
end
#==============================================================================
# ** Sprite_WindowCursor
#==============================================================================
class Sprite_WindowCursor < Sprite
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  attr_accessor :blink
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize(name,viewport)
    super(viewport)
    self.bitmap = Cache.system(name)
    self.src_rect.set(0, 0, CW, CH)
    self.opacity = 0
    @xx = -8
    @wait = WAIT
    @count = 0
    @blink = false
  end
  #--------------------------------------------------------------------------
  # * Dispose
  #--------------------------------------------------------------------------
  def dispose
    super
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    super
    @xx += 1 if @xx != 0
    self.x += @xx
    @count += 1
    self.visible = false if @blink and (@count % 4) == 0
    @wait -= 1
    return if @wait > 0
    @wait = WAIT
    self.src_rect.x += CW
    self.src_rect.x = 0 if (self.bitmap.width <= self.src_rect.x)
  end
end



[Tienes que estar registrado y conectado para ver esa imagen]
Linksen
Linksen
300
300

Masculino

Edad 30

Cantidad de envíos 306

Maker Cash 1769

Reputación 23


Extras
Sobre mí::

Volver arriba Ir abajo

[Script] Cursor Sprite + Smooth Movement Empty Re: [Script] Cursor Sprite + Smooth Movement

Mensaje por Maahkehro Lun 22 Oct 2012, 2:33 pm

No te cuesta nada traducir la información xD.
Muy bueno el aporte, aunque ya está bastante repetido aquí. Y DEJA DE HACER APORTES, VAS A FLOODEAR EL FORO. LOL.
Maahkehro
Maahkehro
300
300

Masculino

Edad 26

Cantidad de envíos 431

Maker Cash 1888

Reputación 81


Extras
Sobre mí:: Si no me das +1 a mis aportes, saco mi Ametralladora lanza-cuchillos y me convierto en un Dios Oscuro come-hombres e.e

Volver arriba Ir abajo

Volver arriba

- Temas similares

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