Skip to main content

Quad

Description:

  A quadrilateral (a polygon with four sides and four corners) with texture coordinate information.

type

Type: Function.

Description:

  Gets the type of the object as a string.

Signature:

type: function(self: Quad): string

Returns:

Return TypeDescription
stringThe type as a string.

Of

Type: Function.

Description:

  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.

Signature:

typeOf: function(self: Quad, type_name: string): boolean

Parameters:

ParameterTypeDescription
type_namestringThe name of the type to check for.

Returns:

Return TypeDescription
booleanTrue if the object is of the specified type, false otherwise.

release

Type: Function.

Description:

  Destroys the object's Lua reference. The object will be completely deleted if it's not referenced by any other LÖVE object or thread. This method can be used to immediately clean up resources without waiting for Lua's garbage collector.

Signature:

release: function(self: Quad): boolean

Returns:

Return TypeDescription
booleanTrue if the object was released by this call, false if it had been previously released.

setViewport

Type: Function.

Description:

  Sets the texture coordinates according to a viewport.

Signature:

setViewport: function(self: Quad, x: number, y: number, width: number, height: number, texture_width?: number, texture_height?: number)

Parameters:

ParameterTypeDescription
xnumberThe top-left corner along the x-axis.
ynumberThe top-left corner along the y-axis.
widthnumberThe width of the viewport.
heightnumberThe height of the viewport.
texture_widthnumberOptional new reference width, the width of the Texture. Must be greater than 0 if set. (Default: nil.)
texture_heightnumberOptional new reference height, the height of the Texture. Must be greater than 0 if set. (Default: nil.)

getViewport

Type: Function.

Description:

  Gets the current viewport of this Quad.

Signature:

getViewport: function(self: Quad): number, number, number, number

Returns:

Return TypeDescription
numberThe top-left corner along the x-axis.
numberThe top-left corner along the y-axis.
numberThe width of the viewport.
numberThe height of the viewport.

getTextureDimensions

Type: Function.

Description:

  Gets reference texture dimensions initially specified in love.graphics.newQuad.

Signature:

getTextureDimensions: function(self: Quad): number, number
setLayer: function(self: Quad, layer: integer)
getLayer: function(self: Quad): integer

Parameters:

ParameterTypeDescription
layerintegerThe layer parameter.

Returns:

Return TypeDescription
number or integerThe Texture width used by the Quad.
numberThe Texture height used by the Quad.