Bitmap API Reference


b5.Bitmap

A bitmap represents a bit-mapped image that can be displayed by Actors. Generally a Bitmap should be added to either a scene or the global app’s resources so that it can be managed by them

Public properties

  • name – The name of the bitmap, this name is used when searching for bitmap resources in a Scene’s resources or the the app’s global resources
  • location – The location of the bitmap file that is used to create the image
  • parent – The parent container
  • onload – Callback function which will be called when the bitmap has been loaded
  • loaded – Set to true when the bitmap has been loaded

Private properties

  • image – An image object that represents the bitmap

Methods

Bitmap(name, location, preload, onload) – Creates an instance of a Bitmap object.

  • name – Name of the bitmap
  • location – The bitmap file location
  • preload – If set to true then the bitmap will be loaded when created
  • onload – Callback function that will be called when the image has been loaded

load() – Loads the bitmap, used in cases where the bitmap is not preloaded

destroy() – Removes the bitmap from the scene / app and destroys it

Examples

Creating a bitmap image

 

662 total views, 1 views today