Skip to content

SpriteImage

Overview

Represents an image with a specific center "offset". Considered immutable (with an immutable image, the Canvas if provided should not change).

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

Class SpriteImage

import { SpriteImage } from 'scenerystack/scenery';

Constructor

new SpriteImage( image : ImageableImage | TReadOnlyProperty<ImageableImage>, offset : Vector2, providedOptions? : SpriteImageOptions )

Instance Methods

getShape() : Shape

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

containsPoint( point : Vector2 ) : boolean

Returns whether a given point is considered "inside" the SpriteImage.

Instance Properties

id : number

(readonly)

offset : Vector2

(readonly)

pickable : boolean

(readonly)

Type SpriteImageOptions

import type { SpriteImageOptions } from 'scenerystack/scenery';

Source Code

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