Skip to content

EyeDropperNode

Overview

Eye dropper, with a button for dispensing whatever is in the dropper.

@author Chris Malley (PixelZoom, Inc.)

Class EyeDropperNode

import { EyeDropperNode } from 'scenerystack/scenery-phet';

Constructor

new EyeDropperNode( provideOptions? : EyeDropperNodeOptions )

Instance Methods

dispose()

getFluidColor() : TPaint

Gets the color of the fluid in the dropper.

setFluidColor( color : TPaint )

Sets the color of the fluid in the dropper.

Instance Properties

isDispensingProperty : Property<boolean>

(readonly)

is the dropper dispensing?

isEmptyProperty : Property<boolean>

(readonly)

is the dropper empty of fluid?

button : Node

(readonly)

for clients who want to hide the button

Static Properties

TIP_WIDTH

(readonly)

You'll need these if you want to create fluid coming out of the tip.

TIP_HEIGHT

(readonly)

GLASS_WIDTH

(readonly)

GLASS_MIN_Y

(readonly)

You'll need these if you want to put a label on the glass. Values are relative to bottom center.

GLASS_MAX_Y

(readonly)

Type EyeDropperNodeOptions

import type { EyeDropperNodeOptions } from 'scenerystack/scenery-phet';

Source Code

See the source for EyeDropperNode.ts in the scenery-phet repository.