class TextureWriter |
Parent: Object |
|
Methods: count, filename, handle, length, load, write, write_all |
|
Sample Code: TextureWriter.rb |
|
Instance Methods |
count |
The count method is used to determine the number of textures loaded into the texture writer. |
Syntax: |
count = texturewriter.count |
Arguments: |
|
Return Value: |
count - the number of textures loaded in the texture writer |
Comments: |
|
Example: |
count = tw.count |
filename |
The filename method is used to retrieve the original filename for a particular texture. |
Syntax: |
filename = texturewriter.filename handle |
Arguments: |
handle - the index or handle of the texture in the texture writer |
Return Value: |
filename - the filename of the texture on the file system |
Comments: |
|
Example: |
filename = tw.filename 1 |
handle |
The handle method is used to retrieve a handle or index for a specific texture in the texture writer. |
Syntax: |
handle = texturewriter.handle entity, <side> |
Arguments: |
entity - a face, image, component instance, group, or layer <side> - if the entity is a face, the side represents the side whose handle you are retrieving (true if front, false if back) |
Return Value: |
handle - the index for the entity in the texture writer |
Comments: |
|
Example: |
index = tw.handle myface |
length |
The length method is used to determine the number of textures loaded into the texture writer. |
Syntax: |
length = texturewriter.count |
Arguments: |
|
Return Value: |
length - the number of textures loaded in the texture writer |
Comments: |
|
Example: |
|
load |
The load method is used to load one or more textures into the texture writer for writing out to a file. |
Syntax: |
handle = texturewriter entity, <side> |
Arguments: |
entity - entity - a face, image, component instance, group, or layer to load <side> - if the entity is a face, the side is used to indicate the side of the face being loaded (true if front, false if back) |
Return Value: |
handle - the index or handle of the entity that was loaded |
Comments: |
|
Example: |
index = tw.load myface |
write |
The write method is used to write an individual textures, within the texture writer, to a file. |
Syntax: |
status = texturewriter.write entity, <side>, filename |
Arguments: |
entity - a face, image, component instance, group, or layer to write. filename - the name of the file to contain the texture <side> - if the entity is a face, the side is used to indicate the side of the face being written (true if front, false if back) |
Return Value: |
status - one of three status messages (see comments) |
Comments: |
(0) FILE_WRITE_OK |
Example: |
retval = tw.write(ent, true, "C:\\textures\\A.jpg") |
write_all |
The write_all method is used to write all textures, held in the texture writer, to files. |
Syntax: |
status = texturewriter.write_all directory, filetype |
Arguments: |
directory - the directory for the textures being written filetype - the file naming convention to be used (true for 8.3, false for extended) |
Return Value: |
status - one of three status messages (see comments) |
Comments: |
(0) FILE_WRITE_OK |
Example: |
tw.write_all("C:\\textures", false) |