Skip to content

Block

Overview

A specialized drawable for a layer of drawables with the same renderer (basically, it's a Canvas element, SVG element, or some type of DOM container). Doesn't strictly have to have its DOM element used directly (Canvas block used for caches). This type is abstract, and meant to be subclassed.

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

Class Block

import { Block } from 'scenerystack/scenery';

Instance Methods

initialize( display, renderer )

@public

@param {Display} display @param {number} renderer

dispose()

Releases references @public @override

addDrawable( drawable )

Adds a drawable to this block. @public

@param {Drawable} drawable

removeDrawable( drawable )

Removes a drawable from this block. @public

@param {Drawable} drawable

onIntervalChange( firstDrawable, lastDrawable )

@protected

@param {Drawable} firstDrawable @param {Drawable} lastDrawable

updateInterval()

@public

notifyInterval( firstDrawable, lastDrawable )

@public

@param {Drawable} firstDrawable @param {Drawable} lastDrawable

audit( allowPendingBlock, allowPendingList, allowDirty )

Runs checks on the drawable, based on certain flags. @public @override

@param {boolean} allowPendingBlock @param {boolean} allowPendingList @param {boolean} allowDirty

Source Code

See the source for Block.js in the scenery repository.