mirror of
https://github.com/vrld/hump.git
synced 2024-11-23 12:24:19 +00:00
Update doc: Add list of functions to every module
Gives a nice overview and makes it easier to navigate the docs.
This commit is contained in:
parent
88f501bc77
commit
945423f9f5
@ -21,6 +21,30 @@ worry about that.
|
|||||||
camera:move(dx/2, dy/2)
|
camera:move(dx/2, dy/2)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
List of Functions
|
||||||
|
-----------------
|
||||||
|
|
||||||
|
* :func:`Camera.new(x,y, zoom, rot) <Camera.new>`
|
||||||
|
* :func:`camera:move(dx,dy) <camera:move>`
|
||||||
|
* :func:`camera:lookAt(x,y) <camera:lookAt>`
|
||||||
|
* :func:`camera:position() <camera:position>`
|
||||||
|
* :func:`camera:rotate(angle) <camera:rotate>`
|
||||||
|
* :func:`camera:rotateTo(angle) <camera:rotateTo>`
|
||||||
|
* :func:`camera:zoom(mul) <camera:zoom>`
|
||||||
|
* :func:`camera:zoomTo(zoom) <camera:zoomTo>`
|
||||||
|
* :func:`camera:attach() <camera:attach>`
|
||||||
|
* :func:`camera:detach() <camera:detach>`
|
||||||
|
* :func:`camera:draw(func) <camera:draw>`
|
||||||
|
* :func:`camera:worldCoords(x, y) <camera:worldCoords>`
|
||||||
|
* :func:`camera:cameraCoords(x, y) <camera:cameraCoords>`
|
||||||
|
* :func:`camera:mousePosition() <camera:mousePosition>`
|
||||||
|
* :func:`camera:lockX(x, smoother, ...) <camera:lockX>`
|
||||||
|
* :func:`camera:lockY(y, smoother, ...) <camera:lockY>`
|
||||||
|
* :func:`camera:lockPosition(x,y, smoother, ...) <camera:lockPosition>`
|
||||||
|
* :func:`camera:lockWindow(x,y, x_min, x_max, y_min, y_max, smoother, ...) <camera:lockWindow>`
|
||||||
|
* :func:`Camera.smooth.none() <Camera.smooth.none>`
|
||||||
|
* :func:`Camera.smooth.linear(speed) <Camera.smooth.linear>`
|
||||||
|
* :func:`Camera.smooth.damped(stiffness) <Camera.smooth.damped>`
|
||||||
|
|
||||||
Function Reference
|
Function Reference
|
||||||
------------------
|
------------------
|
||||||
|
@ -29,11 +29,19 @@ Implements `class commons <https://github.com/bartbes/Class-Commons>`_.
|
|||||||
love.graphics.draw(self.img, self.pos.x, self.pos.y)
|
love.graphics.draw(self.img, self.pos.x, self.pos.y)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
List of Functions
|
||||||
|
-----------------
|
||||||
|
|
||||||
|
* :func:`Class.new() <Class.new>`
|
||||||
|
* :func:`class.init(object, ...) <class.init>`
|
||||||
|
* :func:`Class:include(other) <Class:include>`
|
||||||
|
* :func:`class:clone() <class:clone>`
|
||||||
|
|
||||||
Function Reference
|
Function Reference
|
||||||
------------------
|
------------------
|
||||||
|
|
||||||
.. function:: Class.new()
|
.. function:: Class.new()
|
||||||
.. function:: Class.new({init = constructor, __includes = parents, ...})
|
Class.new({init = constructor, __includes = parents, ...})
|
||||||
|
|
||||||
:param function constructor: Class constructor. Can be accessed with ``theclass.init(object, ...)``. (optional)
|
:param function constructor: Class constructor. Can be accessed with ``theclass.init(object, ...)``. (optional)
|
||||||
:param class or table of classes parents: Classes to inherit from. Can either be a single class or a table of classes. (optional)
|
:param class or table of classes parents: Classes to inherit from. Can either be a single class or a table of classes. (optional)
|
||||||
|
@ -42,6 +42,17 @@ A typical game could consist of a menu-state, a level-state and a game-over-stat
|
|||||||
Gamestate.switch(menu)
|
Gamestate.switch(menu)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
List of Functions
|
||||||
|
-----------------
|
||||||
|
|
||||||
|
* :func:`Gamestate.new() <Gamestate.new>`
|
||||||
|
* :func:`Gamestate.switch(to, ...) <Gamestate.switch>`
|
||||||
|
* :func:`Gamestate.Gamestate.current() <Gamestate.Gamestate.current>`
|
||||||
|
* :func:`Gamestate.push(to, ...) <Gamestate.push>`
|
||||||
|
* :func:`Gamestate.pop(...) <Gamestate.pop>`
|
||||||
|
* :func:`Gamestate.<callback>(...) <Gamestate.<callback>>`
|
||||||
|
* :func:`Gamestate.registerEvents([callbacks]) <Gamestate.registerEvents>`
|
||||||
|
|
||||||
|
|
||||||
.. _callbacks:
|
.. _callbacks:
|
||||||
|
|
||||||
|
@ -2,13 +2,20 @@
|
|||||||
=======================================================
|
=======================================================
|
||||||
|
|
||||||
**hump** is a set of lightweight helpers for the awesome `LÖVE
|
**hump** is a set of lightweight helpers for the awesome `LÖVE
|
||||||
<http://love2d.org>`_ game framework. It will help to get you over the initial
|
<http://love2d.org>`_ game framework.
|
||||||
hump when starting to build a new game.
|
It will help to get you over the initial hump when starting to build a new
|
||||||
|
game.
|
||||||
|
|
||||||
**hump** differs from many other libraries in that every component is
|
**hump** does nothing that you couldn't do yourself.
|
||||||
independent of the remaining ones.
|
But why should you?
|
||||||
The footprint is very small, so the library should fit nicely into your
|
You want to write games, not boilerplate!
|
||||||
projects.
|
|
||||||
|
**hump**'s components are so loosely coupled that every component is
|
||||||
|
independent of the others.
|
||||||
|
You can choose what you need and leave the rest behind.
|
||||||
|
hump wont judge.
|
||||||
|
|
||||||
|
**hump** just wants to make you happy.
|
||||||
|
|
||||||
Read on
|
Read on
|
||||||
-------
|
-------
|
||||||
|
@ -42,6 +42,18 @@ signals that match a `Lua string pattern
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
List of Functions
|
||||||
|
-----------------
|
||||||
|
|
||||||
|
* :func:`Signal.new() <Signal.new>`
|
||||||
|
* :func:`Signal.register(s, f) <Signal.register>`
|
||||||
|
* :func:`Signal.emit(s, ...) <Signal.emit>`
|
||||||
|
* :func:`Signal.remove(s, ...) <Signal.remove>`
|
||||||
|
* :func:`Signal.clear(s) <Signal.clear>`
|
||||||
|
* :func:`Signal.emitPattern(p, ...) <Signal.emitPattern>`
|
||||||
|
* :func:`Signal.removePattern(p, ...) <Signal.removePattern>`
|
||||||
|
* :func:`Signal.clearPattern(p) <Signal.clearPattern>`
|
||||||
|
|
||||||
Function Reference
|
Function Reference
|
||||||
------------------
|
------------------
|
||||||
|
|
||||||
|
@ -26,6 +26,19 @@ easier to produce `juicy games <http://www.youtube.com/watch?v=Fy0aCDmgnxg>`_.
|
|||||||
Timer.update(dt)
|
Timer.update(dt)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
List of Functions
|
||||||
|
-----------------
|
||||||
|
|
||||||
|
* :func:`Timer.new() <Timer.new>`
|
||||||
|
* :func:`Timer.after(delay, func) <Timer.after>`
|
||||||
|
* :func:`Timer.script(func) <Timer.script>`
|
||||||
|
* :func:`Timer.every(delay, func, count) <Timer.every>`
|
||||||
|
* :func:`Timer.during(delay, func, after) <Timer.during>`
|
||||||
|
* :func:`Timer.cancel(handle) <Timer.cancel>`
|
||||||
|
* :func:`Timer.clear() <Timer.clear>`
|
||||||
|
* :func:`Timer.update(dt) <Timer.update>`
|
||||||
|
* :func:`Timer.tween(duration, subject, target, method, after, ...) <Timer.tween>`
|
||||||
|
|
||||||
Function Reference
|
Function Reference
|
||||||
------------------
|
------------------
|
||||||
|
|
||||||
@ -152,7 +165,7 @@ wait is: ``wait(delay)``.
|
|||||||
end)
|
end)
|
||||||
|
|
||||||
|
|
||||||
.. function:: Timer.every(delay, func[, count])
|
.. function:: Timer.every(delay, func, count)
|
||||||
|
|
||||||
:param number delay: Number of seconds between two consecutive function calls.
|
:param number delay: Number of seconds between two consecutive function calls.
|
||||||
:param function func: The function to be called periodically.
|
:param function func: The function to be called periodically.
|
||||||
@ -184,7 +197,7 @@ or :func:`Timer.cancel` or :func:`Timer.clear` is called on the timer instance.
|
|||||||
end)
|
end)
|
||||||
|
|
||||||
|
|
||||||
.. function:: Timer.during(delay, func[, after])
|
.. function:: Timer.during(delay, func, after)
|
||||||
|
|
||||||
:param number delay: Number of seconds the func will be called.
|
:param number delay: Number of seconds the func will be called.
|
||||||
:param function func: The function to be called on ``update(dt)``.
|
:param function func: The function to be called on ``update(dt)``.
|
||||||
@ -303,7 +316,7 @@ Update timers and execute functions if the deadline is reached. Call in
|
|||||||
:param string method: Tweening method, defaults to 'linear' (:ref:`see here
|
:param string method: Tweening method, defaults to 'linear' (:ref:`see here
|
||||||
<tweening-methods>`, optional).
|
<tweening-methods>`, optional).
|
||||||
:param function after: Function to execute after the tween has finished
|
:param function after: Function to execute after the tween has finished
|
||||||
(optiona).
|
(optional).
|
||||||
:param mixed ...: Additional arguments to the *tweening* function.
|
:param mixed ...: Additional arguments to the *tweening* function.
|
||||||
:returns: A timer handle.
|
:returns: A timer handle.
|
||||||
|
|
||||||
|
@ -44,6 +44,35 @@ An table-free version of :doc:`hump.vector <vector>`. Instead of a vector type,
|
|||||||
player.y = player.y + dt * player.vely
|
player.y = player.y + dt * player.vely
|
||||||
end
|
end
|
||||||
|
|
||||||
|
List of Functions
|
||||||
|
-----------------
|
||||||
|
|
||||||
|
* :func:`vector.str(x,y) <vector.str>`
|
||||||
|
* :func:`vector.fromPolar(angle, radius) <vector.fromPolar>`
|
||||||
|
* :func:`vector.toPolar(x, y) <vector.toPolar>`
|
||||||
|
* :func:`vector.randomDirection(len_min, len_max) <vector.randomDirection>`
|
||||||
|
* :func:`vector.mul(s, x,y) <vector.mul>`
|
||||||
|
* :func:`vector.div(s, x,y) <vector.div>`
|
||||||
|
* :func:`vector.add(x1,y1, x2,y2) <vector.add>`
|
||||||
|
* :func:`vector.sub(x1,y1, x2,y2) <vector.sub>`
|
||||||
|
* :func:`vector.permul(x1,y1, x2,y2) <vector.permul>`
|
||||||
|
* :func:`vector.dot(x1,y1, x2,y2) <vector.dot>`
|
||||||
|
* :func:`vector.cross(x1,y1, x2,y2) <vector.cross>`
|
||||||
|
* :func:`vector.vector.det(x1,y1, x2,y2) <vector.vector.det>`
|
||||||
|
* :func:`vector.eq(x1,y1, x2,y2) <vector.eq>`
|
||||||
|
* :func:`vector.le(x1,y1, x2,y2) <vector.le>`
|
||||||
|
* :func:`vector.lt(x1,y1, x2,y2) <vector.lt>`
|
||||||
|
* :func:`vector.len(x,y) <vector.len>`
|
||||||
|
* :func:`vector.len2(x,y) <vector.len2>`
|
||||||
|
* :func:`vector.dist(x1,y1, x2,y2) <vector.dist>`
|
||||||
|
* :func:`vector.dist2(x1,y1, x2,y2) <vector.dist2>`
|
||||||
|
* :func:`vector.normalize(x,y) <vector.normalize>`
|
||||||
|
* :func:`vector.rotate(phi, x,y) <vector.rotate>`
|
||||||
|
* :func:`vector.perpendicular(x,y) <vector.perpendicular>`
|
||||||
|
* :func:`vector.project(x,y, u,v) <vector.project>`
|
||||||
|
* :func:`vector.mirror(x,y, u,v) <vector.mirror>`
|
||||||
|
* :func:`vector.angleTo(ox,y, u,v) <vector.angleTo>`
|
||||||
|
* :func:`vector.trim(max_length, x,y) <vector.trim>`
|
||||||
|
|
||||||
Function Reference
|
Function Reference
|
||||||
------------------
|
------------------
|
||||||
|
@ -41,6 +41,33 @@ You can access the individual coordinates by ``vec.x`` and ``vec.y``.
|
|||||||
player.position = player.position + player.velocity * dt
|
player.position = player.position + player.velocity * dt
|
||||||
end
|
end
|
||||||
|
|
||||||
|
List of Functions
|
||||||
|
-----------------
|
||||||
|
|
||||||
|
* :func:`vector.new(x,y) <vector.new>`
|
||||||
|
* :func:`vector.fromPolar(angle, radius) <vector.fromPolar>`
|
||||||
|
* :func:`vector.randomDirection(len_min, len_max) <vector.randomDirection>`
|
||||||
|
* :func:`vector.isvector(v) <vector.isvector>`
|
||||||
|
* :func:`vector:clone() <vector:clone>`
|
||||||
|
* :func:`vector:unpack() <vector:unpack>`
|
||||||
|
* :func:`vector:permul(other) <vector:permul>`
|
||||||
|
* :func:`vector:len() <vector:len>`
|
||||||
|
* :func:`vector:toPolar() <vector:toPolar>`
|
||||||
|
* :func:`vector:len2() <vector:len2>`
|
||||||
|
* :func:`vector:dist(other) <vector:dist>`
|
||||||
|
* :func:`vector:dist2(other) <vector:dist2>`
|
||||||
|
* :func:`vector:normalized() <vector:normalized>`
|
||||||
|
* :func:`vector:normalizeInplace() <vector:normalizeInplace>`
|
||||||
|
* :func:`vector:rotated(angle) <vector:rotated>`
|
||||||
|
* :func:`vector:rotateInplace(angle) <vector:rotateInplace>`
|
||||||
|
* :func:`vector:perpendicular() <vector:perpendicular>`
|
||||||
|
* :func:`vector:projectOn(v) <vector:projectOn>`
|
||||||
|
* :func:`vector:mirrorOn(v) <vector:mirrorOn>`
|
||||||
|
* :func:`vector:cross(other) <vector:cross>`
|
||||||
|
* :func:`vector:angleTo(other) <vector:angleTo>`
|
||||||
|
* :func:`vector:trimmed(max_length) <vector:trimmed>`
|
||||||
|
* :func:`vector:trimInplace(max_length) <vector:trimInplace>`
|
||||||
|
|
||||||
|
|
||||||
Vector arithmetic
|
Vector arithmetic
|
||||||
-----------------
|
-----------------
|
||||||
|
Loading…
Reference in New Issue
Block a user