abstract class WFC::Texture
- WFC::Texture
- Reference
- Object
Overview
Abstract class that allows a texture type to interface with WFC.
To add WFC generation for a texture type, inherit this class, implementing
its methods according to the needs of your texture type. For image textures,
this would mean implementing conversion methods to and from a pixel array;
for the implemented CharTexture type, this means writing codepoints to a
buffer, etc.
Direct Known Subclasses
Defined in:
wfc.crConstructors
- 
        .new(bytes, width, height)
        
          Creates a new texture from bytes, width, and height. 
Instance Method Summary
- 
        #bytes_per_cell
        
          The number of bytes per cell in the texture. 
- 
        #generate(*arguments)
        
          Calls WFC.generatewith the passed arguments andselfas the texture.
- 
        #height
        
          The height of the texture. 
- 
        #to_bytes : Bytes
        
          Converts the texture to a Bytes.
- 
        #width
        
          The width of the texture. 
Constructor Detail
Instance Method Detail
The number of bytes per cell in the texture. For example, in a char-based texture such as the one provided in the module, this is 1, since each cell is a single byte.
Calls WFC.generate with the passed arguments and self as the texture.
Does not need to be overridden in subclasses.