Foundation.TextureRegion

Defines a rectangular region (or all!) of a game texture. Texture regions are the fill types for drawable objects.


Example


// Texture regions are the fill types for drawable objects
var sprite = new Foundation.Sprite(
  new Foundation.Rectangle(0, 0, 200, 300), 
  someTexture.getRegion('all')
);


Implementation Details

Reference paths

  • '/foundation/_digest.ts'
  • '/foundation/core/actors/_digest.ts'
  • '/foundation/core/actors/TextureRegion.ts'

Extends

This type extends:

equals check is based the referenced texture and bounds

Implements

This type does not implement any interfaces (except those in the base).


Public Properties

texture: Texture

  • Reference to the region's texture object.

bounds: Rectangle

  • Bounding rectangle which defines the region.

Constructors

(texture: Texture, bounds: Rectangle)

  • Pass reference to a texture, and a rectangle region to target in that texture.
  • Note: Regions will usually be created by using a Texture object's addRegion() method.