Documentation
LearnPen Drawing
Description
LearnPen Drawing addon allows users to draw images on a digital canvas using LearnPen. It is possible to define the line thickness, color, and opacity in the editor.
Properties
The list starts with the common properties, learn more about them by visiting the Modules description section. The other available properties are described below.
Property name | Description |
---|---|
LearnPen | When this option is selected, registering from squeeze and pressure sensors are on. |
Colors | If LearnPen is on, color is specified by function (more information below), otherwise the color of pencil is specified in '#RRGGBB' notation or by name, e.g. "pink" |
Thickness | If LearnPen is on, thickness is specified by function (more information below), otherwise the width of pencil is defined by a number between 1 and 40. |
Opacity | If LearnPen is on, opacity is specified by function (more information below), otherwise it's a number between 0 and 1. |
Squeeze limits | Property which defines the squeezes' range. Two numbers (value from and to in percentage) separated with a semicolon, e.g. "54;69". |
Squeeze limits interpretation | Defines how Squeeze limits property should be interpreted. |
Pressure limits | Property which defines the pressure's range. Two numbers (value from and to in percentage) separated with a semicolon, e.g. "34;90". |
Events | In this property, you can define custom events and decide whether they are to be sent. Every event has 5 properties:
|
Mirror | When this option is selected, every point and line will be reflected to the other side of a digital canvas. |
Background color | Background color |
Sensors list
- SQUEEZE_A
- SQUEEZE_B
- SQUEEZE_C
- SQUEEZE_SUM
- SQUEEZE_MAX
- PRESSURE
- ALL
Function as an argument
If LearnPen is on, the properties: Colors, Thickness and Opacity are specified by function. In the first line, type one element from the Sensors list (above). In next lines, use proper values (depending on property) and a number between 1 and 100. Samples:
Property Colors:
SQUEEZE_C
33% red
66% green
100% blue
Now the color depends on the sensor squeeze C: <0%,33%> red, <34%,66%> green, <67%,100%> blue.
Property Thickness:
PRESSURE
50% 15
100% 25
Property Opacity:
ALL
100% 1
Supported commands
Command name | Params | Description |
---|---|---|
hide | --- | Hide the addon. |
show | --- | Show the addon. |
setColor | color name or RGB | Change color and switch from eraser to pencil. |
setThickness | number between 1 and 40 | Change thickness. |
setEraserOn | --- | Switch from pencil to eraser. |
Advanced Connector integration
Each command supported by the LearnPen Drawing addon can be used in the Advanced Connector addon's scripts. The below example shows how to change color (to green) and thickness (to 13) when the image source is selected and Text module's gap content changes.
EVENTSTART
Name:ItemSelected
Item:green
SCRIPTSTART
var learnpendrawing = presenter.playerController.getModule('LearnPen1');
learnpendrawing.setColor('green');
SCRIPTEND
EVENTEND
EVENTSTART
Source:Text1
Item:1
Value:^medium$
SCRIPTSTART
var learnpendrawing = presenter.playerController.getModule('LearnPen1');
learnpendrawing.setThickness(13);
SCRIPTEND
EVENTEND
To turn on eraser, you have to use function:
learnpendrawing.setEraserOn();
To set eraser's Thickness, use function:
learnpendrawing.setEraserThickness(10);
To turn off Eraser, just set pencil color, e.g.:
learnpendrawing.setColor('pink');
Demo presentation
Demo presentation contains examples on how to use the LearnPen Drawing addon.