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

This function is always used to prepare for a corresponding [[love.graphics.pop|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.

== 関数 ==
Pushes the current transformation to the transformation stack.
=== 概要 ===
<source lang="lua">
love.graphics.push( )
</source>
=== 引数 ===
なし。
=== 返値 ===
ありません。

== 関数 ==
{{newin (日本語)|[[0.9.2 (日本語)|0.9.2]]|092|type=異形}}
Pushes a specific type of state to the stack.
=== 概要 ===
<source lang="lua">
love.graphics.push( stack )
</source>
=== 引数 ===
{{param (日本語)|StackType|stack|The type of stack to push (e.g. just transformation state, or all love.graphics state).}}
=== 返値 ===
ありません。

== 用例 ==
Modify and restore the coordinate system.
<source lang="lua">
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
</source>
----
{{newin|[[0.9.2]]|092|type=example}}
Modify love.graphics state in a function, and restore it easily so other code isn't disturbed.
<source lang="lua">
function DrawCoolThing()
    love.graphics.push("all") -- save all love.graphics state so any changes can be restored

    love.graphics.setColor(0, 0, 255)
    love.graphics.setBlendMode("subtract")

    love.graphics.circle("fill", 400, 300, 80)

    love.graphics.pop() -- restore the saved love.graphics state
end

function love.draw()
    love.graphics.setColor(255, 128, 128)
    love.graphics.circle("fill", 400, 300, 100)

    DrawCoolThing()

    love.graphics.rectangle("fill", 600, 200, 200, 200) -- still uses the color set at the top of love.draw
end
</source>

== 関連 ==
* [[parent::love.graphics (日本語)]]
* [[love.graphics.pop (日本語)]]
* [[love.graphics.translate (日本語)]]
* [[love.graphics.rotate (日本語)]]
* [[love.graphics.scale (日本語)]]
* [[love.graphics.shear (日本語)]]
* [[love.graphics.origin (日本語)]]
* [[StackType (日本語)]]
[[Category:Functions (日本語)]]
{{#set:Description=Copies and pushes the current coordinate transformation to the transformation stack.}}
{{#set:Since=000}}
{{#set:Sub-Category=Coordinate System (日本語)}}
== そのほかの言語 ==
{{i18n (日本語)|love.graphics.push}}