Skip to content

Sprite

Under Construction

This documentation is auto-generated, and is a work in progress. Please see the source code at https://github.com/phetsims/scenery/blob/main/js/util/Sprite.ts for the most up-to-date information.

Overview

Represents a single sprite for the Sprites node, whose image can change over time (if it gets regenerated, etc.).

@author Jonathan Olson <jonathan.olson@colorado.edu>

Class Sprite

import { Sprite } from 'scenerystack/scenery';

Constructor

new Sprite( spriteImage : SpriteImage )

Instance Methods

getShape() : Shape

Returns a Shape that represents the hit-testable area of this Sprite.

containsPoint( point : Vector2 ) : boolean

Returns whether a given point is considered "inside" the Sprite

Instance Properties

imageProperty : TProperty<SpriteImage>

(readonly)

Source Code

See the source for Sprite.ts in the scenery repository.