Bucket¶
Overview¶
Class that defines the shape and common functionality for a 'bucket', which is a container into which some sort of model objects may be placed. This is a model object in the Model-View-Controller paradigm, and requires a counterpart in the view in order to be presented to the user.
In general, this is intended to be a base class, and subclasses should be used to add specific functionality, such as how other model objects are added to and removed from the bucket.
One other important note: The position of the bucket in model space is based on the center of the bucket's opening.
@author John Blanco @author Jonathan Olson <jonathan.olson@colorado.edu>
Class Bucket¶
Constructor¶
new Bucket( providedOptions? : BucketOptions )¶
Instance Methods¶
Instance Properties¶
position : Vector2¶
The position is defined to be where the center of the hole is.
baseColor : TColor | null¶
(readonly)
Base color of the bucket.
captionText : string¶
(readonly)
Caption to be shown on the bucket.
captionColor : TColor¶
(readonly)
Color for the caption.
size : Dimension2¶
(readonly)
The size of the bucket.
holeShape : Shape¶
(readonly)
Create the shape of the bucket's hole.
containerShape : Shape¶
(readonly)
The shape of the front portion of the bucket.
Type BucketOptions¶
- position?: Vector2
- size?: Dimension2
- baseColor?: TColor
- captionText?: string
- captionColor?: TColor
- invertY?: boolean
- & PhetioObjectOptions
Source Code¶
See the source for Bucket.ts in the phetcommon repository.