API Docs for: 1.4.0
Show:

Kiwi.Textures.SingleImage Class

Extends TextureAtlas
Module: Textures
Parent Module: Kiwi

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]
)
Kiwi.SingleImage

Parameters:

  • name String

    The name of the single image

  • image HTMLImageElement/HTMLCanvasElement

    the image that is being used.

  • [width] Number optional

    the width of the image

  • [height] Number optional

    the height of the image

  • [offsetX] Number optional

    the offset of the image on the x axis. Useful if the image has a border that you don't want to show.

  • [offsetY] Number optional

    the offset of the image of the y axis. Useful if the image has a border that you don't want to show.

Returns:

Kiwi.SingleImage:

Item Index

Methods

generateAtlasCells

() Array public

This method generates the single image cell based off the information that was passed during instantion.

Returns:

Array:

objType

() String public

The type of object that this is.

Returns:

String:

"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.