mirror of
https://github.com/vrld/hump.git
synced 2024-11-23 12:24:19 +00:00
Document changes in camera.lua.
This commit is contained in:
parent
49a115d9a3
commit
1cb943c70d
38
doc.lua
38
doc.lua
@ -1367,8 +1367,6 @@ Module { name = "hump.camera",
|
|||||||
title = "Camera",
|
title = "Camera",
|
||||||
short = "A camera for LÖVE",
|
short = "A camera for LÖVE",
|
||||||
long = [===[
|
long = [===[
|
||||||
{!Depends on hump.vector-light}
|
|
||||||
|
|
||||||
A camera utility for LÖVE. A camera can "look" at a position. It can zoom in and
|
A camera utility for LÖVE. A camera can "look" at a position. It can zoom in and
|
||||||
out and it can rotate it's view. In the background, this is done by actually
|
out and it can rotate it's view. In the background, this is done by actually
|
||||||
moving, scaling and rotating everything in the game world. But don't worry about
|
moving, scaling and rotating everything in the game world. But don't worry about
|
||||||
@ -1423,6 +1421,19 @@ cam = camera(100,100, 2, math.pi/2)
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
|
Function { name = "camera:rotation",
|
||||||
|
short = "Get camera rotation.",
|
||||||
|
long = [===[Returns {#camera.rot}.]===],
|
||||||
|
|
||||||
|
params = {},
|
||||||
|
|
||||||
|
returns = {
|
||||||
|
{"number", "Rotation angle in radians."}
|
||||||
|
},
|
||||||
|
|
||||||
|
example = [===[love.graphics.print(camera:rotation(), 10, 10)]===],
|
||||||
|
},
|
||||||
|
|
||||||
Function { name = "camera:move",
|
Function { name = "camera:move",
|
||||||
short = "Move camera object.",
|
short = "Move camera object.",
|
||||||
long = [===[
|
long = [===[
|
||||||
@ -1439,10 +1450,33 @@ cam = camera(100,100, 2, math.pi/2)
|
|||||||
},
|
},
|
||||||
|
|
||||||
example = {
|
example = {
|
||||||
|
"function love.update(dt)\n camera:move(dt * 5, dt * 6)\nend",
|
||||||
"function love.update(dt)\n camera:move(dt * 5, dt * 6):rotate(dt)\nend"
|
"function love.update(dt)\n camera:move(dt * 5, dt * 6):rotate(dt)\nend"
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
|
Function { name = "camera:pos",
|
||||||
|
short = "Get camera position..",
|
||||||
|
long = [===[Returns {#camera.x, camera.y}.]===],
|
||||||
|
|
||||||
|
params = {},
|
||||||
|
|
||||||
|
returns = {
|
||||||
|
{"numbers", "Camera position."},
|
||||||
|
},
|
||||||
|
|
||||||
|
example = [===[-- let the camera fly!
|
||||||
|
local cam_dx, cam_dy = 0, 0
|
||||||
|
function love.mousereleased(x,y)
|
||||||
|
local cx,cy = camera:position()
|
||||||
|
dx, dy = x-cx, y-cy
|
||||||
|
end
|
||||||
|
|
||||||
|
function love.update(dt)
|
||||||
|
camera:move(dx * dt, dy * dt)
|
||||||
|
end]===],
|
||||||
|
},
|
||||||
|
|
||||||
Function { name = "camera:attach",
|
Function { name = "camera:attach",
|
||||||
short = "Attach camera object.",
|
short = "Attach camera object.",
|
||||||
long = [===[
|
long = [===[
|
||||||
|
15
index.html
15
index.html
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user