Sha256: eed720a64f2c31dfb050ed53e69da9d22d8bdf1dbffbb678bd8a05e6b369d293

Contents?: true

Size: 908 Bytes

Versions: 12

Compression:

Stored size: 908 Bytes

Contents

require 'mittsu/math'
require 'mittsu/materials/material'

# @author alteredq / http://alteredqualia.com/
#
# parameters = {
#  color: <hex>,
#  opacity: <float>,
#  map: new THREE.Texture( <Image> ),
#
#  blending: THREE.NormalBlending,
#  depthTest: <bool>,
#  depthWrite: <bool>,
#
#	uvOffset: new THREE.Vector2(),
#	uvScale: new THREE.Vector2(),
#
#  fog: <bool>
# }
module Mittsu
  class SpriteMaterial < Material
    attr_accessor :map, :rotation, :fog

    def initialize(parameters = {})
      super()

      @type = 'SpriteMaterial'

      @color = Color.new(0xffffff)
      @map = nil

      @rotation = 0.0

      @fog = false

      set_values(parameters)
    end

    def clone
      material = SpriteMaterial.new
      super(material)

      material.color.copy(@color)
      material.map = @map

      material.rotation = @rotation

      material.fog = @fog

      material
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
mittsu-0.5.0 lib/mittsu/materials/sprite_material.rb
mittsu-0.4.1 lib/mittsu/materials/sprite_material.rb
mittsu-0.4.0 lib/mittsu/materials/sprite_material.rb
mittsu-0.3.3 lib/mittsu/materials/sprite_material.rb
mittsu-0.3.2 lib/mittsu/materials/sprite_material.rb
mittsu-0.3.1 lib/mittsu/materials/sprite_material.rb
mittsu-0.3.0 lib/mittsu/materials/sprite_material.rb
mittsu-0.2.4 lib/mittsu/materials/sprite_material.rb
mittsu-0.2.3 lib/mittsu/materials/sprite_material.rb
mittsu-0.2.2 lib/mittsu/materials/sprite_material.rb
mittsu-0.2.1 lib/mittsu/materials/sprite_material.rb
mittsu-0.2.0 lib/mittsu/materials/sprite_material.rb