Class: ModraUp::TextureWriter
- Inherits:
-
Object
- Object
- ModraUp::TextureWriter
Overview
Write textures on faces, groups, and component instances. Created by ModraUp.create_texture_writer.
Constants # collapse
- ModraUp::TextureWriter::FILE_WRITE_OK
ModraUp::TextureWriter::FILE_WRITE_OK = 0
Equivalent to FILE_WRITE_OK.
- ModraUp::TextureWriter::FILE_WRITE_FAILED_INVALID_TYPE
ModraUp::TextureWriter::FILE_WRITE_FAILED_INVALID_TYPE = 1
Same as top-level FILE_WRITE_FAILED_INVALID_TYPE.
- ModraUp::TextureWriter::FILE_WRITE_FAILED_UNKNOWN
ModraUp::TextureWriter::FILE_WRITE_FAILED_UNKNOWN = 2
Same as top-level FILE_WRITE_FAILED_UNKNOWN.
Instance Method Summary # collapse
-
#load(entity) ⇒ Integer
Loads an entity's texture. For faces, pass true for side to use the front material, or false for the back. Handles start at 1. Returns 0 on failure.
-
#write(entity, filename) ⇒ Integer
Write the texture that has been #load to the file based on the file extension. For a two-parameter call, write the front side; for a three-parameter call with the side parameter set to true, write the front side, and set to false to write the back side. Returns FILE_WRITE_OK / FILE_WRITE_FAILED_INVALID_TYPE / FILE_WRITE_FAILED_UNKNOWN.
-
#write_all(dirname) ⇒ Integer
Write the loaded textures to the directory. Returns the number of files written.
-
#length ⇒ Integer
Number of textures loaded.
-
#count ⇒ Integer
Alias for #length.
-
#handle(entity) ⇒ Integer
Returns the handle of a loaded entity. Set side to false for its back face. Returns 0 if the entity has not been loaded.
-
#filename(handle) ⇒ String
The texture path loaded during #load. An invalid handle is represented as an empty string.
Instance Method Details
writer.load(entity) ⇒ Integerwriter.load(face, side) ⇒ Integer
Loads an entity's texture. For faces, pass true for side to use the front material, or false for the back. Handles start at 1. Returns 0 on failure.
writer.write(entity, filename) ⇒ Integerwriter.write(entity, side, filename) ⇒ Integer
Write the texture that has been #load to the file based on the file extension. For a two-parameter call, write the front side; for a three-parameter call with the side parameter set to true, write the front side, and set to false to write the back side. Returns FILE_WRITE_OK / FILE_WRITE_FAILED_INVALID_TYPE / FILE_WRITE_FAILED_UNKNOWN.
writer.write_all(dirname) ⇒ Integerwriter.write_all(dirname, filename_format) ⇒ Integer
Write the loaded textures to the directory. Returns the number of files written.
writer.length ⇒ Integer
Number of textures loaded.
writer.count ⇒ Integer
Alias for #length.
writer.handle(entity) ⇒ Integerwriter.handle(entity, side) ⇒ Integer
Returns the handle of a loaded entity. Set side to false for its back face. Returns 0 if the entity has not been loaded.
writer.filename(handle) ⇒ String
The texture path loaded during #load. An invalid handle is represented as an empty string.