love.graphics

The primary responsibility for the love.graphics module is the drawing of lines, shapes, text, Images and other Drawable objects onto the screen. Its secondary responsibilities include loading external files (including Images and Fonts) into memory, creating specialized objects (such as ParticleSystems or Canvases) and managing screen geometry. LÖVE's coordinate system is rooted in the upper-left corner of the screen, which is at location (0, 0). The x axis is horizontal: larger values are further to the right. The y axis is vertical: larger values are further towards the bottom. In many cases, you draw images or shapes in terms of their upper-left corner. Many of the functions are used to manipulate the graphics coordinate system, which is essentially the way coordinates are mapped to the display. You can change the position, scale, and even rotation in this way. [Open in Browser](https://love2d.org/wiki/love.graphics)


Methods




love.graphics.getTransform()

Gets a copy of the Transform object for the current coordinate transformation.

Returns:

transform: love.Transform

A copy of the Transform object for the current coordinate transformation.



love.graphics.getTransformRef()

Gets a direct reference of the Transform object for the current coordinate transformation.

Returns:

transform_ref: love.Transform

A direct reference of the Transform object for the current coordinate transformation.



love.graphics.inverseTransformPoint(screenX: any, screenY: any)

Arguments:

screenX: any
screenY: any

Returns:

1: number
2: number






love.graphics.printfOutline(text: string, x: number, y: number, outline: number, limit: number?, align: (love.AlignMode)?, r: number?, sx: number?, sy: number?, ox: number?, oy: number?, kx: number?, ky: number?)

Draws formatted text, with word wrap, alignment and outline.

See additional notes in love.graphics.print.

The word wrap limit is applied before any scaling, rotation, and other coordinate transformations. Therefore the amount of text per line stays constant given the same wrap limit, even if the scale arguments change.

-- 
-- Text alignment.
-- 
-- 
-- [Open in Browser](https://love2d.org/wiki/AlignMode)
-- 
align:
    | "center" -- Align text center.
    | "left" -- Align text left.
    | "right" -- Align text right.
    | "justify" -- Align text both left and right.

Arguments:

text: string

A text string.

x: number

The position on the x-axis.

y: number

The position on the y-axis.

outline: number

The size of the outline.

limit: number?

Wrap the line after this many horizontal pixels.

align: (love.AlignMode)?

The alignment.

r: number?

Orientation (radians).

sx: number?

Scale factor (x-axis).

sy: number?

Scale factor (y-axis).

ox: number?

Origin offset (x-axis).

oy: number?

Origin offset (y-axis).

kx: number?

Shearing factor (x-axis).

ky: number?

Shearing factor (y-axis).









love.graphics.rotate(angle: any)

Arguments:

angle: any


love.graphics.scale(sx: any, sy: any)

Arguments:

sx: any
sy: any


love.graphics.shear(kx: any, ky: any)

Arguments:

kx: any
ky: any


love.graphics.transformPoint(globalX: any, globalY: any)

Arguments:

globalX: any
globalY: any

Returns:

1: number
2: number


love.graphics.translate(dx: any, dy: any)

Arguments:

dx: any
dy: any



Fields



Undocumented