Skip to content

@tmrw-realityos/worldDocs


@tmrw-realityos/world / Clock

Class: Clock

Extends

Constructors

new Clock()

new Clock(): Clock

Returns

Clock

Overrides

SurfaceApp.constructor

Defined in

world/surfaceApps/clock.ts:11

Properties

ctx?

optional ctx: CanvasRenderingContext2D

Inherited from

SurfaceApp.ctx

Defined in

world/surfaceApps/surfaceApp.ts:4


cursor

cursor: vec2

Overrides

SurfaceApp.cursor

Defined in

world/surfaceApps/clock.ts:8


fontsLoaded

fontsLoaded: Set<string>

Inherited from

SurfaceApp.fontsLoaded

Defined in

world/surfaceApps/surfaceApp.ts:7


hoverButton

hoverButton: string = ""

Defined in

world/surfaceApps/clock.ts:5


layerOffset

layerOffset: vec3

Inherited from

SurfaceApp.layerOffset

Defined in

world/surfaceApps/surfaceApp.ts:6


mode

mode: string = "analog"

Defined in

world/surfaceApps/clock.ts:7


time

time: number[]

Defined in

world/surfaceApps/clock.ts:9

Methods

draw()

draw(canvas, ctx, cursor): void

Parameters

canvas: HTMLCanvasElement

ctx: CanvasRenderingContext2D

cursor: vec2

Returns

void

Overrides

SurfaceApp.draw

Defined in

world/surfaceApps/clock.ts:17


drawAnalog()

drawAnalog(ctx, radius): void

Parameters

ctx: CanvasRenderingContext2D

radius: number

Returns

void

Defined in

world/surfaceApps/clock.ts:64


drawButton()

drawButton(label, x, y, w, h): undefined | boolean

Parameters

label: string

x: number

y: number

w: number

h: number

Returns

undefined | boolean

Inherited from

SurfaceApp.drawButton

Defined in

world/surfaceApps/surfaceApp.ts:17


drawDigital()

drawDigital(ctx, radius): void

Parameters

ctx: CanvasRenderingContext2D

radius: number

Returns

void

Defined in

world/surfaceApps/clock.ts:139


loadFont()

loadFont(name): void

Parameters

name: string

Returns

void

Inherited from

SurfaceApp.loadFont

Defined in

world/surfaceApps/surfaceApp.ts:42


onMouse()

onMouse(e, _cursor): void

Parameters

e: PointerEvent

_cursor: vec2

Returns

void

Overrides

SurfaceApp.onMouse

Defined in

world/surfaceApps/clock.ts:161


onUpdate()?

optional onUpdate(dt): void

Parameters

dt: number

Returns

void

Inherited from

SurfaceApp.onUpdate

Defined in

world/surfaceApps/surfaceApp.ts:15