|
|
(2 intermediate revisions by the same user not shown) |
Line 1: |
Line 1: |
− | {{newin|[[0.9.0]]|090|new=function}}
| |
− | Creates a new [[Geometry]].
| |
− | == Function ==
| |
− | === Synopsis ===
| |
− | <source lang="lua">
| |
− | geometry = love.graphics.newGeometry( vertices )
| |
− | </source>
| |
− | === Arguments ===
| |
− | {{param|table|vertices|The table filled with vertex information tables for each vertex as follows:}}
| |
− | {{subparam|number|[1]|The x vertex coordinate.}}
| |
− | {{subparam|number|[2]|The y vertex coordinate.}}
| |
− | {{subparam|number|[3]|The u texture coordinate.}}
| |
− | {{subparam|number|[4]|The v texture coordinate.}}
| |
− | {{subparam|number|[5] (255)|The red color component.}}
| |
− | {{subparam|number|[6] (255)|The green color component.}}
| |
− | {{subparam|number|[7] (255)|The blue color component.}}
| |
− | {{subparam|number|[8] (255)|The alpha color component.}}
| |
− | === Returns ===
| |
− | {{param|Geometry|quad|The new geometry.}}
| |
− | <!--
| |
− | Transform this to apply to geometries.
| |
− | === Note ===
| |
− | The purpose of a Quad is to describe the result of the following transformation on any drawable object. The object is first scaled to dimensions sw × sh. The Quad then describes the rectangular area of dimensions width × height whose upper left corner is at position (x, y) inside the scaled object.
| |
| | | |
− | == Examples ==
| |
− | === Use a Quad to display part of an Image: ===
| |
− | <source lang="lua">
| |
− | img = love.graphics.newImage("mushroom-64x64.png")
| |
− |
| |
− | -- Let's say we want to display only the top-left
| |
− | -- 32x32 quadrant of the Image:
| |
− | top_left = love.graphics.newQuad(0, 0, 32, 32, 64, 64)
| |
− |
| |
− | -- And here is bottom left:
| |
− | bottom_left = love.graphics.newQuad(0, 32, 32, 32, 64, 64)
| |
− |
| |
− | function love.draw()
| |
− | love.graphics.drawg(img, top_left, 50, 50)
| |
− | love.graphics.drawg(img, bottom_left, 50, 200)
| |
− | end
| |
− | </source>
| |
− | -->
| |
− | == See Also ==
| |
− | * [[parent::love.graphics]]
| |
− | * [[Constructs::Geometry]]
| |
− | [[Category:Functions]]
| |
− | [[Sub-Category::Object Creation| ]]
| |
− | {{#set:Description=Creates a new [[Geometry]].}}
| |
− | == Other Languages ==
| |
− | {{i18n|love.graphics.newGeometry}}
| |