Ogłoszenie 

Uwaga! To forum jest w trybie offline.
Wszelką pomoc uzyskasz pod adresem
forum.ultimateam.pl


Administracja Forum


Poprzedni temat «» Następny temat
Gryzoń w VxA, czyli kursor
Autor Wiadomość
Diablo 




Preferowany:
RPG Maker VX

Pomógł: 5 razy
Dołączył: 25 Lip 2010
Posty: 155
  Wysłany: Pon 30 Kwi, 2012 14:49
Gryzoń w VxA, czyli kursor
~ MENU CURSOR ~


Krótki opis:
Dodaje kursor w menu.

Autor:
YANFLY

Kompatybilność:
RPG Maker VX Ace

Skrypt:
Spoiler:

Kod:
#==============================================================================
#
#  Yanfly Engine Ace - Menu Cursor v1.00
# -- Last Updated: 2012.01.16
# -- Level: Easy
# -- Requires: n/a
#
#==============================================================================

$imported = {} if $imported.nil?
$imported["YEA-MenuCursor"] = true

#==============================================================================
#  Updates
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# 2012.01.16 - Started Script and Finished.
#
#==============================================================================
#  Introduction
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# This script creates visible menu cursors for your game. Whenever a window is
# selectable and active, the menu cursor will appear for it. Menu cursors catch
# the player's attention better and helps the player figure out quickly which
# window became the active window. Also included with this script is the
# ability to disable the highlighted selection bar since the window menu cursor
# can replace it.
#
#==============================================================================
#  Instructions
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# To install this script, open up your script editor and copy/paste this script
# to an open slot below  Materials/素材 but above  Main. Remember to save.
#
# Make sure you have a cursor image within your project's Graphics\System\
# folder. By default, the cursor's filename should be MenuCursor.
#
#==============================================================================
#  Compatibility
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# This script is made strictly for RPG Maker VX Ace. It is highly unlikely that
# it will run with RPG Maker VX without adjusting.
#
#==============================================================================

module YEA
  module MENU_CURSOR
   
    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    # - General Settings -
    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    # Adjust the general settings here for the menu cursor, such as the
    # filename used for the menu cursor, the x position buffer and the y
    # position buffer for the cursor.
    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    FILENAME = "MenuCursor"     # Filename used for cursor in Graphics\System\
    BUFFER_X = -4               # X position buffer for icon.
    BUFFER_Y = 16               # Y position buffer for icon.
   
    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    # - Remove Highlighted Selection Bar -
    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    # Normally, when an entry is selected, that entry is highlighted. You can
    # opt to turn this effect off.
    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    REMOVE_HIGHLIGHTED_SELECTION_BAR = false
   
  end # MENU_CURSOR
end # YEA

#==============================================================================
#  Editting anything past this point may potentially result in causing
# computer damage, incontinence, explosion of user's head, coma, death, and/or
# halitosis so edit at your own risk.
#==============================================================================

#==============================================================================
# ■ Sprite_MenuCursor
#==============================================================================

class Sprite_MenuCursor < Sprite_Base
 
  #--------------------------------------------------------------------------
  # initialize
  #--------------------------------------------------------------------------
  def initialize(window)
    super(window.viewport)
    @window = window
    create_bitmap
  end
 
  #--------------------------------------------------------------------------
  # create_bitmap
  #--------------------------------------------------------------------------
  def create_bitmap
    self.bitmap = Cache.system(YEA::MENU_CURSOR::FILENAME)
    self.z = @window.z + 100
    self.opacity = 0
  end
 
  #--------------------------------------------------------------------------
  # update
  #--------------------------------------------------------------------------
  def update
    super
    update_visibility
    update_position
  end
 
  #--------------------------------------------------------------------------
  # update_visibility
  #--------------------------------------------------------------------------
  def update_visibility
    self.visible = visible_case
    self.opacity += opacity_rate
  end
 
  #--------------------------------------------------------------------------
  # visible_case
  #--------------------------------------------------------------------------
  def visible_case
    return @window.visible
  end
 
  #--------------------------------------------------------------------------
  # opacity_rate
  #--------------------------------------------------------------------------
  def opacity_rate
    rate = 16
    return -rate unless @window.active
    return rate
  end
 
  #--------------------------------------------------------------------------
  # update_position
  #--------------------------------------------------------------------------
  def update_position
    rect = @window.cursor_rect
    self.x = @window.x + rect.x - @window.ox + YEA::MENU_CURSOR::BUFFER_X
    self.y = @window.y + rect.y - @window.oy + YEA::MENU_CURSOR::BUFFER_Y
  end
 
end # Sprite_MenuCursor

#==============================================================================
# &#9632; Window
#==============================================================================

class Window
 
  #--------------------------------------------------------------------------
  # alias method: windowskin=
  #--------------------------------------------------------------------------
  alias window_windowskin_change_cursor windowskin=
  def windowskin=(skin)
    if YEA::MENU_CURSOR::REMOVE_HIGHLIGHTED_SELECTION_BAR
      skin = skin.dup
      skin.clear_rect(64, 64, 32, 32)
    end
    window_windowskin_change_cursor(skin)
  end
 
end # Window

#==============================================================================
# &#9632; Scene_Base
#==============================================================================

class Scene_Base
 
  #--------------------------------------------------------------------------
  # alias method: post_start
  #--------------------------------------------------------------------------
  alias scene_base_post_start_cursor post_start
  def post_start
    create_menu_cursors
    scene_base_post_start_cursor
  end
 
  #--------------------------------------------------------------------------
  # new method: create_menu_cursors
  #--------------------------------------------------------------------------
  def create_menu_cursors
    @menu_cursors = []
    instance_variables.each do |varname|
      ivar = instance_variable_get(varname)
      create_cursor_sprite(ivar) if ivar.is_a?(Window_Selectable)
    end
  end
 
  #--------------------------------------------------------------------------
  # new method: create_cursor_sprite
  #--------------------------------------------------------------------------
  def create_cursor_sprite(window)
    @menu_cursors.push(Sprite_MenuCursor.new(window))
  end
 
  #--------------------------------------------------------------------------
  # alias method: pre_terminate
  #--------------------------------------------------------------------------
  alias scene_base_pre_terminate_cursor pre_terminate
  def pre_terminate
    dispose_menu_cursors
    scene_base_pre_terminate_cursor
  end
 
  #--------------------------------------------------------------------------
  # new method: dispose_menu_cursors
  #--------------------------------------------------------------------------
  def dispose_menu_cursors
    @menu_cursors.each { |cursor| cursor.dispose }
  end
 
  #--------------------------------------------------------------------------
  # alias method: update_basic
  #--------------------------------------------------------------------------
  alias scene_base_update_basic_cursor update_basic
  def update_basic
    scene_base_update_basic_cursor
    update_menu_cursors
  end
 
  #--------------------------------------------------------------------------
  # new method: update_menu_cursors
  #--------------------------------------------------------------------------
  def update_menu_cursors
    @menu_cursors.each { |cursor| cursor.update }
  end
 
end # Scene_Base

#==============================================================================
#
#  End of File
#
#==============================================================================


Screeny:
Spoiler:



Dodatkowe informacje:
Skrypt wymaga jeszcze tej grafiki:
http://yanflychannel.file.../menucursor.png
________________________



 
 
MrBoomGood 




Preferowany:
RPG Maker VX

Pomógł: 3 razy
Dołączył: 07 Kwi 2011
Posty: 292
Skąd: Katowice
Wysłany: Sro 02 Maj, 2012 09:26
Grafike do folderu System dla niewiedzących ^^
 
 
 
Jaro 



Preferowany:
RPG Maker VX

Dołączył: 18 Cze 2010
Posty: 25
Wysłany: Sob 05 Maj, 2012 23:56
Tak dla informacji, nie da się tym kursorem poruszać, działa jedynie jako grafika obok opcji w menu.
 
 
Wyświetl posty z ostatnich:   
Odpowiedz do tematu
Nie możesz pisać nowych tematów
Nie możesz odpowiadać w tematach
Nie możesz zmieniać swoich postów
Nie możesz usuwać swoich postów
Nie możesz głosować w ankietach
Nie możesz załączać plików na tym forum
Możesz ściągać załączniki na tym forum
Dodaj temat do Ulubionych
Wersja do druku

Skocz do:  

Powered by phpBB modified by Przemo © 2003 phpBB Group | Template Klam by Ayene