Class: Mittsu::SpriteMaterial
- Defined in:
- lib/mittsu/materials/sprite_material.rb
Instance Attribute Summary collapse
-
#fog ⇒ Object
Returns the value of attribute fog.
-
#map ⇒ Object
Returns the value of attribute map.
-
#rotation ⇒ Object
Returns the value of attribute rotation.
Attributes inherited from Material
#alpha_map, #alpha_test, #attributes, #blend_dst, #blend_dst_alpha, #blend_equation, #blend_equation_alpha, #blend_src, #blend_src_alpha, #blending, #bump_map, #color, #color_write, #combine, #default_attribute_values, #defines, #depth_test, #depth_write, #env_map, #fragment_shader, #id, #light_map, #lights, #metal, #morph_normals, #morph_targets, #name, #normal_map, #opacity, #overdraw, #polygon_offset, #polygon_offset_factor, #polygon_offset_units, #program, #reflectivity, #refraction_ratio, #shading, #side, #size_attenuation, #skinning, #specular_map, #transparent, #type, #uniforms, #uuid, #vertex_colors, #vertex_shader, #visible, #wireframe, #wrap_around
Instance Method Summary collapse
- #clone ⇒ Object
-
#initialize(parameters = {}) ⇒ SpriteMaterial
constructor
A new instance of SpriteMaterial.
Methods inherited from Material
#dispose, #needs_update=, #needs_update?, #set_values, #to_json, #update
Methods included from EventDispatcher
#add_event_listener, #dispatch_event, #has_event_listener, #remove_event_listener
Constructor Details
#initialize(parameters = {}) ⇒ SpriteMaterial
Returns a new instance of SpriteMaterial.
24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/mittsu/materials/sprite_material.rb', line 24 def initialize(parameters = {}) super() @type = 'SpriteMaterial' @color = Color.new(0xffffff) @map = nil @rotation = 0.0 @fog = false set_values(parameters) end |
Instance Attribute Details
#fog ⇒ Object
Returns the value of attribute fog.
22 23 24 |
# File 'lib/mittsu/materials/sprite_material.rb', line 22 def fog @fog end |
#map ⇒ Object
Returns the value of attribute map.
22 23 24 |
# File 'lib/mittsu/materials/sprite_material.rb', line 22 def map @map end |
#rotation ⇒ Object
Returns the value of attribute rotation.
22 23 24 |
# File 'lib/mittsu/materials/sprite_material.rb', line 22 def rotation @rotation end |
Instance Method Details
#clone ⇒ Object
39 40 41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/mittsu/materials/sprite_material.rb', line 39 def clone material = SpriteMaterial.new super(material) material.color.copy(@color) material.map = @map material.rotation = @rotation material.fog = @fog material end |