Kiwi.Textures.SingleImage Class
A special type of TextureAtlas that is used when the user has loaded a single image. This type of TextureAtlas contains only one cell which is generally the whole width/height of the image and starts at the coordinates 0/0. A SingleImage has a space to store sequences but this will not be used.
Constructor
Kiwi.Textures.SingleImage
-
name
-
image
-
[width]
-
[height]
-
[offsetX]
-
[offsetY]
Parameters:
-
name
StringThe name of the single image
-
image
HTMLImageElement/HTMLCanvasElementthe image that is being used.
-
[width]
Number optionalthe width of the image
-
[height]
Number optionalthe height of the image
-
[offsetX]
Number optionalthe offset of the image on the x axis. Useful if the image has a border that you don't want to show.
-
[offsetY]
Number optionalthe offset of the image of the y axis. Useful if the image has a border that you don't want to show.
Returns:
Methods
generateAtlasCells
()
Array
public
This method generates the single image cell based off the information that was passed during instantion.
Returns:
objType
()
String
public
The type of object that this is.
Returns:
"SingleImage"
Properties
height
Number
private
The height of the image.
offsetX
Number
private
The offset for the image on the X axis.
offsetY
Number
private
The offset for the image on the Y axis.
width
Number
private
The width of the image.