DrawGrid is used by Plotter to draw the grid lines on a graph. It can however also be used to draw GridLines on any UserView and could even be used to add grid lines to UserViews behind sliders or in any GUI.
Note that DrawGrid does not hold any reference to the UserView but is meant to have its .draw method called inside of the UserView's drawFunc. It only needs to know what bounds the grid lines should be drawn within and what the horizontal and vertical GridLines are.
bounds |
the bounds to draw within. Multiple DrawGrid may be used to draw grids on a single UserView. |
horzGrid |
a GridLines or BlankGridLines or GridLines subclass |
vertGrid |
a GridLines or BlankGridLines or GridLines subclass |
a DrawGrid
For testing new GridLines objects.
horzGrid |
a GridLines object or subclass |
vertGrid |
a GridLines object or subclass |
bounds |
default: 500 @ 400 |
a DrawGrid
This draws to the currently active UserView. This method is meant to be called from inside the drawFunc of a UserView.
nil
set the x gridLines
g |
a GridLines |
self
set the y gridLines
g |
a GridLines |
self
get or set bounds
b |
a Rect |
a Rect
get or set Font
f |
a Font |
a Font
get or set font color
c |
a Color |
a Color
Set the colors of each of the axis.
colors |
an array of two colors: x,y |
self
get or set opacity
float
see Pen smoothing
smoothing
see Pen linePattern
(returnvalue)
private
bounds | |
h | |
v |
(returnvalue)
private A DrawGridX object that draws the x (horizontal) axis
a DrawGridX
private A DrawGridY object that draws the y (vertical) axis
a DrawGridY
safely make a copy of this object and its working members.
a new DrawGrid
private
self