Constructor
new Clock(face_canvas, hand_canvas, x_pos, y_pos, radius, text)
- Source:
Properties:
Name | Type | Description |
---|---|---|
angle |
number | The angle from noon to draw the clock hand. Determined by the |
filler |
boolean | Whether the clock is off. |
highlighted |
boolean | Whether the clock is highlighted in blue. The |
winner |
boolean | Whether the clock was recently selected and should be highlighted in green for the duration of the pause. |
Parameters:
Name | Type | Description |
---|---|---|
face_canvas |
KeyboardCanvas | The KeyboardCanvas instance used to draw the clock faces. |
hand_canvas |
KeyboardCanvas | The KeyboardCanvas instance used to draw the clock hands. |
x_pos |
number | The starting x position in pixels of the clock, calculated in the ClockGrid class. |
y_pos |
number | The starting x position in pixels of the clock, calculated in the ClockGrid class. |
radius |
number | The radius of the clock in pixels, calculated in the ClockGrid class. |
text |
string | The textual component of the clock's option. |
Methods
draw_face()
- Description:
Draws the clock face on the face_canvas without updating the minute hand.
- Source:
draw_hand(clear)
- Description:
Draws the clock minute hand on the clock_hand canvas.
- Source:
Parameters:
Name | Type | Default | Description |
---|---|---|---|
clear |
boolean |
true
|
Whether to clear the canvas of the previously drawn minute hand. |