Click

Entityceramic.Click (Class)

Component that detects click/tap events on visuals.

This component handles pointer down/up events and emits a click event when the user taps on the visual without moving beyond the threshold.

Instance Members

observedDirty: Bool

Default is false, automatically set to true when any of this instance's observable variables has changed.


threshold: Float

Maximum pointer movement allowed before canceling the click. Set to -1 to disable movement cancellation.


entity: Visual

The visual entity this component is attached to.


pressed: Bool

Whether the pointer is currently pressed on this visual.


initializerName: String

invalidatePressed(): Void

cancel(): Void

Cancel the current click operation.


new(): Void

Private Members

unobservedPressed: Bool

pointerStartX: Float

pointerStartY: Float

emitObservedDirty(instance: Click, fromSerializedField: Bool): Void

Event when any observable value as changed on this instance.

Name Type
instance Click
fromSerializedField Bool

emitClick(): Void

Event fired when the visual is clicked/tapped.


emitPressedChange(current: Bool, previous: Bool): Void

Event when pressed field changes.

Name Type
current Bool
previous Bool

bindAsComponent(): Void

handlePointerDown(info: TouchInfo): Void
Name Type
info TouchInfo

handlePointerUp(info: TouchInfo): Void
Name Type
info TouchInfo

handlePointerMove(info: TouchInfo): Void
Name Type
info TouchInfo

handleBlur(): Void

setEntity(entity: Entity): Void
Name Type
entity Entity

getEntity(): Entity
Returns
Entity

Metadata

Name Parameters
:build tracker.macros.ObservableMacro.build()
:autoBuild tracker.macros.ObservableMacro.build()
:build ceramic.macros.ComponentMacro.build()
:autoBuild ceramic.macros.ComponentMacro.build()
:build ceramic.macros.EntityMacro.buildForCompletion()
:autoBuild ceramic.macros.EntityMacro.buildForCompletion()
:build tracker.macros.EventsMacro.build()
:autoBuild tracker.macros.EventsMacro.build()