Advertisement
Guest User

Untitled

a guest
Sep 20th, 2013
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 4.86 KB | None | 0 0
  1. =begin
  2.  
  3.  Picture Below Characters Ace
  4.  by Woratana
  5.  Port by PK8
  6.  Created: 2/22/2009
  7.  Ported: 4/25/2012
  8.  Modified: 4/25/2012
  9.  ──────────────────────────────────────────────────────────────────────────────
  10.  ■ Table of Contents
  11.    ○ Introduction & Description                    - Line 17-18
  12.    ○ Features                                      - Line 20-22
  13.    ○ Methods Aliased                               - Line 24-26
  14.    ○ Thanks                                        - Line 28-29
  15.    ○ Changelog                                     - Line 31-33
  16.  ──────────────────────────────────────────────────────────────────────────────
  17.  ■ Introduction & Description
  18.    Show pictures above the tiles but underneath the characters on the map.
  19.  ──────────────────────────────────────────────────────────────────────────────
  20.  ■ Features
  21.    o Set which pictures would appear under the characters.
  22.    o The selected pictures will appear above tiles but below characters.
  23.  ──────────────────────────────────────────────────────────────────────────────
  24.  ■ Methods Aliased
  25.    o Spriteset_Map.create_pictures
  26.    o Sprite_Picture.update
  27.  ──────────────────────────────────────────────────────────────────────────────
  28.  ■ Thanks
  29.    Woratana for making the script this was ported from.
  30.  ──────────────────────────────────────────────────────────────────────────────
  31.  ■ Changelog (MM/DD/YYYY)
  32.    v1    (2/22/2009) - Initial release.
  33.    v1 Ace(4/25/2012) - Ported to Ace.
  34.  
  35. =end
  36.  
  37. #===============================================================================​
  38. # * Configuration
  39. #===============================================================================​
  40. module Picture_Below
  41.   ID_From = 15  # Set from which picture IDs will appear under the characters.
  42.   ID_To   = 20  # Set which picture ID this stops at.
  43. end
  44.  
  45. #==============================================================================
  46. # ** Spriteset_Map
  47. #------------------------------------------------------------------------------
  48. #  This class brings together map screen sprites, tilemaps, etc.
  49. #  It's used within the Scene_Map class.
  50. #==============================================================================
  51.  
  52. class Spriteset_Map
  53.   #---------------------------------------------------------------------------
  54.   # * Alias Listings
  55.   #---------------------------------------------------------------------------
  56.   unless method_defined?(:wora_picbelow_create_pictures)
  57.     alias_method(:wora_picbelow_create_pictures, :create_pictures)
  58.   end
  59.   #--------------------------------------------------------------------------
  60.   # * Create Picture Sprite
  61.   #--------------------------------------------------------------------------
  62.   def create_pictures
  63.     wora_picbelow_create_pictures
  64.     for i in Picture_Below::ID_From..Picture_Below::ID_To
  65.       # Create picture below player in viewport1.
  66.       @picture_sprites[i] = Sprite_Picture.new(@viewport1,
  67.         $game_map.screen.pictures[i])
  68.     end
  69.   end
  70. end
  71.  
  72. #==============================================================================
  73. # ** Sprite_Picture
  74. #------------------------------------------------------------------------------
  75. #  This sprite is used to display the picture.It observes the Game_Character
  76. #  class and automatically changes sprite conditions.
  77. #==============================================================================
  78.  
  79. class Sprite_Picture < Sprite
  80.   #---------------------------------------------------------------------------
  81.   # * Alias Listings
  82.   #---------------------------------------------------------------------------
  83.   unless method_defined?(:wora_picbelow_update)
  84.     alias_method(:wora_picbelow_update, :update)
  85.   end
  86.   #--------------------------------------------------------------------------
  87.   # * Frame Update
  88.   #--------------------------------------------------------------------------
  89.   def update
  90.     wora_picbelow_update
  91.     self.z = $game_player.screen_z - 1 if (@picture.number >=
  92.       Picture_Below::ID_From and @picture.number <= Picture_Below::ID_To)
  93.   end
  94. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement