Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #==============================================================================
- #** Quasi Animation Random +- Size
- #==============================================================================
- module Quasi
- # Change this value to set the amount to + or - it's animation size
- # Default is set in a range (-20..20) if you are to change the values
- # in a range, make sure the smaller number is on the left, and larger on the
- # right Ex: -100..-99 NOT -99..-100
- # You can set this as an interger, such as only -20- this would result in the
- # same as 0..20
- # Positive values make the animation larger, while negative make it smaller.
- ANI_ZOOM = -20..20
- # Add the ID of animations you do not want this effect to happen to, in this
- # array. Example array:
- # ANI_FIXED = [1, 5, 10]
- # Would result in animations 1, 5 and 10 to always have the same size
- ANI_FIXED = []
- end
- #==============================================================================#
- # By Quasi (http://quasixi.wordpress.com/)
- # - 8/23/14
- #==============================================================================#
- # ** Stop! Do not edit anything below, unless you know what you **
- # ** are doing! **
- #==============================================================================#
- #==============================================================================
- # ** Sprite_Base
- #------------------------------------------------------------------------------
- # A sprite class with animation display processing added.
- #==============================================================================
- class Sprite_Base < Sprite
- alias quasi_start_animation start_animation
- alias quasi_animation_set animation_set_sprites
- #--------------------------------------------------------------------------
- # * Start Animation
- #--------------------------------------------------------------------------
- def start_animation(animation, mirror = false)
- quasi_start_animation(animation, mirror)
- if @animation
- @rand = Random.new.rand(Quasi::ANI_ZOOM)
- end
- end
- #--------------------------------------------------------------------------
- # * Set Animation Sprite
- # frame : Frame data (RPG::Animation::Frame)
- #--------------------------------------------------------------------------
- def animation_set_sprites(frame)
- quasi_animation_set(frame)
- return if Quasi::ANI_FIXED.include?(@animation.id)
- cell_data = frame.cell_data
- @ani_sprites.each_with_index do |sprite, i|
- next unless sprite
- pattern = cell_data[i, 0]
- next if !pattern || pattern < 0
- sprite.zoom_x += @rand/100.0
- sprite.zoom_y += @rand/100.0
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement