Difference between revisions of "love.graphics.scale"

(added scale)
 
m
Line 26: Line 26:
 
[[Category:Functions]]
 
[[Category:Functions]]
 
{{#set:Description=Scales the coordinate system in two dimensions.}}
 
{{#set:Description=Scales the coordinate system in two dimensions.}}
 +
== Other Languages ==
 +
{{i18n|love.graphics.scale}}

Revision as of 20:24, 18 November 2010

Scales the coordinate system in two dimensions.

By default the coordinate system in LÖVE corresponds to the display pixels in horizontal and vertical directions one-to-one, and the x-axis increases towards the right while the y-axis increases downwards. Scaling the coordinate system changes this relation.

After scaling by sx and sy, all coordinates are treated as if they were multiplied by sx and sy. Every result of a drawing operation is also correspondingly scaled, so scaling by (2, 2) for example would mean making everything twice as large in both x- and y-directions. Scaling by a negative value flips the coordinate system in the corresponding direction, which also means everything will be drawn flipped or upside down, or both. Scaling by zero is not a useful operation.

Scaling lasts until love.draw() exits.

Function

Synopsis

love.graphics.scale( sx, sy )

Arguments

number sx
The scaling in the direction of the x-axis.
number sy
The scaling in the direction of the y-axis. If omitted, it defaults to same as parameter sx.

Returns

Nothing.

See Also

Other Languages