Difference between revisions of "love.graphics.push"
m |
(Added documentation for previously undocumented StateStack) |
||
Line 6: | Line 6: | ||
=== Synopsis === | === Synopsis === | ||
<source lang="lua"> | <source lang="lua"> | ||
− | love.graphics.push() | + | love.graphics.push( StackType ) |
</source> | </source> | ||
=== Arguments === | === Arguments === | ||
− | None | + | None. |
+ | {{New feature|0.9.2| | ||
+ | {{param|string|StackType ('transform')|Graphics state stack types used with love.graphics.push..}} | ||
+ | |092}} | ||
=== Returns === | === Returns === | ||
Nothing. | Nothing. | ||
Line 30: | Line 33: | ||
* [[love.graphics.scale]] | * [[love.graphics.scale]] | ||
* [[love.graphics.shear]] | * [[love.graphics.shear]] | ||
+ | * [[StackType]] | ||
[[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.}} |
Revision as of 20:09, 1 April 2015
Copies and pushes the current coordinate transformation to the transformation stack.
This function 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( StackType )
Arguments
None.
string StackType ('transform')
- Graphics state stack types used with love.graphics.push..
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
- love.graphics
- love.graphics.pop
- love.graphics.translate
- love.graphics.rotate
- love.graphics.scale
- love.graphics.shear
- StackType
Other Languages
Dansk –
Deutsch –
English –
Español –
Français –
Indonesia –
Italiano –
Lietuviškai –
Magyar –
Nederlands –
Polski –
Português –
Română –
Slovenský –
Suomi –
Svenska –
Türkçe –
Česky –
Ελληνικά –
Български –
Русский –
Српски –
Українська –
עברית –
ไทย –
日本語 –
正體中文 –
简体中文 –
Tiếng Việt –
한국어
More info