SHARE
TWEET

RMXP Tone Class

ForeverZer0 Feb 16th, 2012 68 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class Tone
  2.    def initialize(r, g, b, a = 0)
  3.       @red = r
  4.       @green = g
  5.       @blue = b
  6.       @gray = a
  7.    end
  8.    def set(r, g, b, a = 0)
  9.       @red = r
  10.       @green = g
  11.       @blue = b
  12.       @gray = a
  13.    end
  14.    def color
  15.       Color.new(@red, @green, @blue, @gray)
  16.    end
  17.    def _dump(d = 0)
  18.       [@red, @green, @blue, @gray].pack('d4')
  19.    end
  20.    def self._load(s)
  21.       Tone.new(*s.unpack('d4'))
  22.    end
  23.    attr_accessor(:red, :green, :blue, :gray)
  24. end
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top