Members
debugMarkerRadius :number
Radius of the main visual elements for debug drawing.
debugPointRadius :number
Radius of point markers for debug drawing.
debugStyle :object
Style used for debug drawing, when null
the style already applied
is used.
debugTextOptions :object
Settings used by the default implementation of drawable.debug()
.
Properties:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
font |
string
|
'monospace' | Font to use when drawing with |
|
font |
number
|
<optional> |
rac.textFormatDefaults.size | Font size to use when drawing with |
fixedDigits |
number
|
2 | Number of decimal digits to print when drawing with |
debugTextStyle :object
Style used for text for debug drawing, when null
the style already
applied is used.
strokeWeightFactor :number
Factor applied to stroke weight setting. Stroke weight is set to
stroke.weight * strokeWeightFactor
when applicable.
- Default Value:
- 1
Methods
setDebugFunction(drawableClass, debugFunction)
Sets the given debugFunction
to perform the debug-drawing for
instances of class drawableClass
.
When a drawable class does not have a debugFunction
setup, calling
drawable.debug()
simply calls draw()
with
debugStyle
applied.
debugFunction
is expected to have the signature:
debugFunction(drawer, objectOfClass, drawsText)
drawer: P5Drawer
- Instance to use for drawingobjectOfClass: drawableClass
- Instance ofdrawableClass
to drawdrawsText: bool
- Whentrue
text should be drawn with additional information.
Parameters:
Name | Type | Description |
---|---|---|
drawableClass |
class
|
Class of the instances to draw |
debugFunction |
function
|
Function that performs debug-drawing |
setDrawFunction(drawableClass, drawFunction)
Sets the given drawFunction
to perform the drawing for instances of
class drawableClass
.
drawFunction
is expected to have the signature:
drawFunction(drawer, objectOfClass)
drawer: P5Drawer
- Instance to use for drawingobjectOfClass: drawableClass
- Instance ofdrawableClass
to draw
Parameters:
Name | Type | Description |
---|---|---|
drawableClass |
class
|
Class of the instances to draw |
drawFunction |
function
|
Function that performs drawing |