Class Fz2D.Texture
| Defined in: | src/renderer/texture.coffee |
Overview
Public: Texture
Instance Method Summary
- ::constructor(image = null, x = 0, y = 0, w = null, h = null) Constructor.
- Fz2D.Texture ::getSubTexture(x, y, w, h) Creates a Sub Texture from a Texture.
- ::load(path) Loads and image.
- ::onload(texture) On load(ed) callback.
- ::toImage() Returns "native" image instance.
Constructor Details
::constructor(image = null, x = 0, y = 0, w = null, h = null) Source
Public: Constructor.
image - color, instance of an image HTML DOM element or another Fz2D.Texture
x - source position on the X axis (default: 0)
y - source position on the Y axis (default: 0)
w - source width (default: image width)
h - source height (default: image height)
Instance Method Details
Fz2D.Texture ::getSubTexture(x, y, w, h) Source
Public: Creates a Sub Texture from a Texture.
x - source position on the X axis (default: 0)
y - source position on the Y axis (default: 0)
w - source width (default: texture height)
h - source height (default: texture height)
Returns a Fz2D.Texture pointng to the same image.
::load(path) Source
Public: Loads and image.
path - relative path
::onload(texture) Source
Public: On load(ed) callback.
texture - Fz2D.Texture
::toImage() Source
Public: Returns "native" image instance.