Function
love.graphics.newQuad( x, y, w, h, sw, sh )
Creates a new Quad.
Synopsis
quad = love.graphics.newQuad( x, y, w, h, sw, sh )
Parameters
x number The top-left position along the x-axis.
y number The top-left position along the y-axis.
w number The width of the Quad.
h number The height of the Quad.
sw number The reference width.
sh number The reference height.
Returns
quad Quad The new Quad.
Examples
Use a Quad to display part of an Image:
  1. img = love.graphics.newImage("mushroom-64x64.png")
  2.  
  3. -- Let's say we want to display only the top-left
  4. -- 32x32 quadrant of the Image:
  5. top_left = love.graphics.newQuad(0, 0, 32, 32, 64, 64)
  6.  
  7. -- And here is bottom left:
  8. bottom_left = love.graphics.newQuad(0, 32, 32, 32, 64, 64)
  9.  
  10. function love.draw()
  11.     love.graphics.drawq(img, top_left, 50, 50)
  12.     love.graphics.drawq(img, bottom_left, 50, 200)
  13. end
Copyright © 2006-2010 LÖVE Development Team.