GPU - quad
Quad, a region from an image, used when drawing an image to only draw that section.
- Available since: GPU: v1.0.0, LIKO-12: v0.6.0
- Last updated in: GPU: v1.0.0, LIKO-12: v0.8.0
Methods:
quad:getTextureDimensions
Gets reference image dimensions initially specified in GPU.quad().
- Available since: quad: v1.0.0, LIKO-12: v0.6.0
- Last updated in: quad: v1.0.0, LIKO-12: v0.6.0
sw, sh = quad:getTextureDimensions()
Returns:
- sw (number): The image width used by the quad.
- sh (number): The image height used by the quad.
quad:getViewport
Gets the current viewport of this quad.
- Available since: quad: v1.0.0, LIKO-12: v0.6.0
- Last updated in: quad: v1.0.0, LIKO-12: v0.6.0
x, y, w, h = quad:getViewport()
Returns:
- x (number): The x coord of the quad's top-left corner.
- y (number): The y coord of the quad's top-left corner.
- w (number): The width of the quad.
- h (number): The height of the quad.
quad:setViewport
Sets the viewport of the quad.
- Available since: quad: v1.0.0, LIKO-12: v0.6.0
- Last updated in: quad: v1.0.0, LIKO-12: v0.6.0
quad:setViewport(x, y, w, h)
Arguments:
- <x> (number): The x coord of the quad's top-left corner.
- <y> (number): The y coord of the quad's top-left corner.
- <w> (number): The width of the quad.
- <h> (number): The height of the quad.
quad:type
Gets the type of the object as a string.
- Available since: quad: v1.0.0, LIKO-12: v0.6.0
- Last updated in: quad: v1.0.0, LIKO-12: v0.6.0
type = quad:type()
Returns:
- type (string): The object type, (Quad).
quad:typeOf
Checks whether an object is of a certain type. If the object has the type with the specified name in its hierarchy, this function will return true.
- Available since: quad: v1.0.0, LIKO-12: v0.6.0
- Last updated in: quad: v1.0.0, LIKO-12: v0.6.0
For GPUQuad, it returns true for the folowing types: 'Object', 'Quad'
bool = quad:typeOf(type)
Arguments:
- <type> (string): The name of the type to check for.
Returns:
- bool (boolean): True if the object is of the specified type, false otherwise.