applyCache method

void applyCache (num x, { num y, { num width, { num height, { bool debugBorder: false, num pixelRatio: 1.0 })

Draws the specified area of this display object to an internal render texture and the engine will use this texture to optimize performance.

This is useful when the display object contains many static children or a Graphics vector object. If the cached area changes, the cache must be refreshed using refreshCache or removed using removeCache.

Implementation

void applyCache(num x, num y, num width, num height,
    {bool debugBorder = false, num pixelRatio = 1.0}) {
  _cache = _cache != null ? _cache : _DisplayObjectCache(this);
  _cache.debugBorder = debugBorder;
  _cache.pixelRatio = pixelRatio;
  _cache.bounds = Rectangle<num>(x, y, width, height);
  _cache.update();
}