Difference between revisions of "Quad"

(Applying listings to included added and removed fields.)
(Warning about bleed)
Line 2: Line 2:
  
 
Quads can be used to select part of a texture to draw. In this way, one large [http://en.wikipedia.org/wiki/Texture_atlas texture atlas] can be loaded, and then split up into sub-images.
 
Quads can be used to select part of a texture to draw. In this way, one large [http://en.wikipedia.org/wiki/Texture_atlas texture atlas] can be loaded, and then split up into sub-images.
 +
 +
{{notice|Quads 'bleed' when scaled, rotated or drawn at non-integer coordinates, even within [[SpriteBatch|SpriteBatches]], to compensate for this, use 1px borders (preferably with the same colors as the actual border)}}
  
 
== Constructors ==
 
== Constructors ==

Revision as of 15:05, 10 May 2013

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

Quads can be used to select part of a texture to draw. In this way, one large texture atlas can be loaded, and then split up into sub-images.

O.png Quads 'bleed' when scaled, rotated or drawn at non-integer coordinates, even within SpriteBatches, to compensate for this, use 1px borders (preferably with the same colors as the actual border)  


Constructors

love.graphics.newQuad Creates a new Quad.

Functions

Object:release Immediately destroys the object's Lua reference. Added since 11.0
Object:type Gets the type of the object as a string.
Object:typeOf Checks whether an object is of a certain type.
Quad:flip Flips this quad horizontally, vertically, or both. Removed in 0.9.0
Quad:getLayer Gets the layer specified by Quad:setLayer. Added since 11.0
Quad:getTextureDimensions Gets reference texture dimensions initially specified in love.graphics.newQuad. Added since 0.10.2
Quad:getViewport Gets the current viewport of this Quad.
Quad:setLayer Sets the layer to use in Array Textures. Added since 11.0
Quad:setViewport Sets the texture coordinates according to a viewport.

Supertypes

See Also


Other Languages