Difference between revisions of "love.graphics.push"

(added push)
 
m
Line 31: Line 31:
 
[[Category:Functions]]
 
[[Category:Functions]]
 
{{#set:Description=Copies and pushes the current coordinate transformation to the transformation stack.}}
 
{{#set:Description=Copies and pushes the current coordinate transformation to the transformation stack.}}
 +
== Other Languages ==
 +
{{i18n|love.graphics.push}}

Revision as of 20:19, 18 November 2010

Copies and pushes the current coordinate transformation to the transformation stack.

This functions is always used to prepare for a corresponding pop operation later. It stores the current coordinate transformation state into the transformation stack and keeps it active. Later changes to the transformation can be undone by using the pop operation, which returns the coordinate transform to the state it was in before calling push.

Function

Synopsis

love.graphics.push()

Arguments

None

Returns

Nothing.

Examples

function love.draw()
	love.graphics.push() -- stores the default coordinate system
	love.graphics.translate(...) -- move the camera position
	love.graphics.scale(...) -- zoom the camera
	-- use the new coordinate system to draw the viewed scene
	love.graphics.pop() -- return to the default coordinates
	-- draw the status display using the screen coordinates
end

See Also

Other Languages