From 3e783fb8587c6d489db1209ec5aa90d2482a955f Mon Sep 17 00:00:00 2001 From: razuro Date: Thu, 8 Jan 2015 13:35:40 +0800 Subject: [PATCH] Change to other tool API As suggested by @irskep https://github.com/literallycanvas/literallycanvas/issues/256#issuecomment-69132286 --- api/LiterallyCanvas.rst | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/api/LiterallyCanvas.rst b/api/LiterallyCanvas.rst index 0dc3587..c83d213 100644 --- a/api/LiterallyCanvas.rst +++ b/api/LiterallyCanvas.rst @@ -184,4 +184,18 @@ Getting information .. js:function:: getPixel(x, y) - Get the color of the given drawing-space pixel as a CSS color string. \ No newline at end of file + Get the color of the given drawing-space pixel as a CSS color string. + +Setting the tool +^^^^^^^^^^^^^^^^ + +.. js:function:: setTool(toolInstance) + + Sets the current tool to `toolInstance`, which should be an instance of an + `LC.tools.Tool` subclass. + + For example: + + .. code-block:: javascript + + lc.setTool(new LC.tools.Eraser())