FreehandTool
@available(iOS 9.0, *)
@objcMembers
@objc(PESDKFreehandTool)
open class FreehandTool : Tool
A FreehandTool
is responsible for creating vertices for a freehand drawing.
-
The color that should be used for this drawing.
Declaration
Swift
open var color: UIColor
-
The hardness that should be used for this drawing. This value is just used to store the value within the drawn paths. The actual stamp setting is done via brush generator. Since that is a fire and forget thing, and we create the brush somewhere else, we use this to keep the information.
Declaration
Swift
open var hardness: CGFloat
-
The brush that should be used for this drawing.
Declaration
Swift
open var brush: Brush?
-
This method starts a path. It is used during the deserialization process to recreate the brushes.
Declaration
Swift
open func beginPath(location: CGPoint, force: CGFloat = 1)
Parameters
location
The starting location.
force
The used force
-
This method continues a path. It is used during the deserialization process to recreate the brushes.
Declaration
Swift
open func continuePath(location: CGPoint, canvas: CanvasView, force: CGFloat = 1)
Parameters
location
The starting location.
canvas
A canvas view.
force
The used force
-
This method ends a path. It is used during the deserialization process to recreate the brushes.
Declaration
Swift
open func endPath(location: CGPoint, canvas: CanvasView, didMove: Bool = true)
Parameters
location
The starting location.
canvas
A canvas view.
didMove
When this is set to false, the path consists of a single point only.