Difference between revisions of "love.graphics.applyTransform"

m
m (Changed "newin" from 0.11.0 to 11.0)
Line 1: Line 1:
{{newin|[[0.11.0]]|110|type=function}}
+
{{newin|[[11.0]]|110|type=function}}
 
Applies the given [[Transform]] object to the current coordinate transformation.
 
Applies the given [[Transform]] object to the current coordinate transformation.
  

Revision as of 00:25, 2 April 2018

Available since LÖVE 11.0
This function is not supported in earlier versions.

Applies the given Transform object to the current coordinate transformation.

This effectively multiplies the existing coordinate transformation's matrix with the Transform object's internal matrix to produce the new coordinate transformation.

Function

Synopsis

love.graphics.applyTransform( transform )

Arguments

Transform transform
The Transform object to apply to the current graphics coordinate transform.

Returns

Nothing.


Examples

local transform = love.graphics.newTransform()
transfom:translate(200, 0)

function love.draw()
    love.graphics.translate(100, 100)
    love.graphics.rectangle("fill", 0, 0, 50, 50)

    love.graphics.applyTransform(transform)
    love.graphics.rectangle("fill", 0, 0, 50, 50)
end

See Also


Other Languages