Difference between revisions of "love.graphics.replaceTransform"

(Created page)
 
m (0.11.0 -> 11.0)
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{newin|[[0.11.0]]|110|type=function}}
+
{{newin|[[11.0]]|110|type=function}}
 
Replaces the current coordinate transformation with the given [[Transform]] object.
 
Replaces the current coordinate transformation with the given [[Transform]] object.
  
Line 14: Line 14:
 
== Examples ==
 
== Examples ==
 
<source lang="lua">
 
<source lang="lua">
local transform = love.graphics.newTransform()
+
local transform = love.math.newTransform()
transfom:translate(200, 0)
+
transform:translate(200, 0)
  
 
function love.draw()
 
function love.draw()

Latest revision as of 18:24, 7 May 2019

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

Replaces the current coordinate transformation with the given Transform object.

Function

Synopsis

love.graphics.replaceTransform( transform )

Arguments

Transform transform
The Transform object to replace the current graphics coordinate transform with.

Returns

Nothing.

Examples

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

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

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

See Also


Other Languages