API reference
API reference
Select your platform
No SDKs available
No versions available

CanvasHoverEffect Class

Implements IHoverEffect
Modifiers: final
Renders a hover effect with:
  • Filled highlight on element outline
  • Radial gradient at hover position
  • Drop shadow outside bounds (disabled by default)
Animation includes:
  • Fade-in: 0 → targetAlphaMax (300ms) → targetAlphaDwell (1600ms)
  • Fade-out: current → 0 (400ms)
  • Velocity-based gradient radius expansion and alpha modulation
Ported from VrShell SystemHoverEffect.java

Constructors

CanvasHoverEffect ( initialPath , initialX , initialY )
Signature
constructor(initialPath: Path, initialX: Float, initialY: Float)
Parameters
initialPath: Path
initialX: Float
initialY: Float

Methods

draw ( canvas )
Draws the effect to the canvas
Signature
open override fun draw(canvas: Canvas)
Parameters
canvas: Canvas
onHover ( x , y , outlinePath )
Called when hover position or outline changes
Signature
open override fun onHover(x: Float, y: Float, outlinePath: Path)
Parameters
x: Float
y: Float
outlinePath: Path
onUnhover ()
Called when hover ends (triggers fade-out)
Signature
open override fun onUnhover()
setOnRemove ( onRemove )
Sets the callback to invoke when the effect should be removed (after fade-out completes)
Signature
open override fun setOnRemove(onRemove: Runnable)
Parameters
onRemove: Runnable
update ( deltaTimeMs )
Updates animation state. Called each frame.
Signature
open override fun update(deltaTimeMs: Long)
Parameters
deltaTimeMs: Long