Class: Mikunyan::CustomTypes::Texture2D
- Inherits:
-
BaseObject
- Object
- ObjectValue
- BaseObject
- Mikunyan::CustomTypes::Texture2D
- Defined in:
- lib/mikunyan/types/texture2d.rb
Instance Attribute Summary
Attributes inherited from BaseObject
Attributes inherited from ObjectValue
#attr, #endian, #is_struct, #name, #type, #value
Instance Method Summary collapse
-
#generate_png ⇒ Object
Generates an png image (an instance of ChunkyPNG::Image) from the texture data.
- #height ⇒ Object
- #mipmap_count ⇒ Object
- #texture_format ⇒ Object
- #width ⇒ Object
Methods inherited from BaseObject
Methods inherited from ObjectValue
#[], #[]=, #array?, #initialize, #key?, #keys, #method_missing, #respond_to_missing?, #simplify, #struct?, #value?
Constructor Details
This class inherits a constructor from Mikunyan::ObjectValue
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Mikunyan::ObjectValue
Instance Method Details
#generate_png ⇒ Object
Generates an png image (an instance of ChunkyPNG::Image) from the texture data
12 13 14 |
# File 'lib/mikunyan/types/texture2d.rb', line 12 def generate_png Mikunyan::Decoder::ImageDecoder.decode_object(self) end |
#height ⇒ Object
20 21 22 |
# File 'lib/mikunyan/types/texture2d.rb', line 20 def height @attr['m_Height']&.value end |
#mipmap_count ⇒ Object
28 29 30 |
# File 'lib/mikunyan/types/texture2d.rb', line 28 def mipmap_count @attr['m_MipCount']&.value end |
#texture_format ⇒ Object
24 25 26 |
# File 'lib/mikunyan/types/texture2d.rb', line 24 def texture_format @attr['m_TextureFormat']&.value end |
#width ⇒ Object
16 17 18 |
# File 'lib/mikunyan/types/texture2d.rb', line 16 def width @attr['m_Width']&.value end |