Artenus 2D Framework
Artenus Reference
Describes how a texture is divided into image blocks for use in an ImageSprite. By introducing a ImageSprite.Cutout object to an ImageSprite, you instruct it how to build its frames based on the texture you provide.
public static final class ImageSprite.Cutout

Constructor Summary

Modifier and TypeConstructor and Description
public Cutout(float frameWidth, float frameHeight, int frameCount)
Creates a cutout that divides the texture into blocks of the given dimensions and takes out the given number of blocks horizontally from the texture.
public Cutout(float frameWidth, float frameHeight, int frameCountW, int frameCountH)
Creates a cutout that divides the texture into blocks of the given dimensions.
public Cutout(float frameWidth, float frameHeight, int frameCountW, int frameCountH, int startX, int startY)
Creates a cutout with the information given.

Method Summary

Modifier and TypeMethod and Description
public floatgetFrameHeight()
Gets the frame (block) height associated with this cutout.
public floatgetFrameWidth()
Gets the frame (block) width associated with this cutout.

Methods inherited from java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

Cutout
public  Cutout(
    float frameWidth,
    float frameHeight,
    int frameCount
)
Creates a cutout that divides the texture into blocks of the given dimensions and takes out the given number of blocks horizontally from the texture. The remainder of the texture will remain unused.
Parameters:
frameWidthThe width of each block
frameHeightThe height of each block
frameCountThe number of blocks to cut out of the image
Cutout
public  Cutout(
    float frameWidth,
    float frameHeight,
    int frameCountW,
    int frameCountH
)
Creates a cutout that divides the texture into blocks of the given dimensions. You can specify the number of columns and rows and it will cut out a grid of blocks from the texture with the given information. The remainder of the texture will remain unused.
Parameters:
frameWidthWidth of each block
frameHeightHeight of each block
frameCountWNumber of horizontal blocks
frameCountHNumber of vertical blocks
Cutout
public  Cutout(
    float frameWidth,
    float frameHeight,
    int frameCountW,
    int frameCountH,
    int startX,
    int startY
)
Creates a cutout with the information given. This constructor is an extension to the Cutout(float, float, int, int) constructor that gives you the option to start at a given point in the texture. This can be useful if you are using large atlas textures.
Parameters:
frameWidthWidth of each block
frameHeightHeight of each block
frameCountWNumber of horizontal blocks
frameCountHNumber of vertical blocks
startXx coordinate of the starting pixel
startYy coordinate of the starting pixel

Method Detail

getFrameHeight
public float getFrameHeight()
Gets the frame (block) height associated with this cutout.
Returns:
The frame height
getFrameWidth
public float getFrameWidth()
Gets the frame (block) width associated with this cutout.
Returns:
The frame width