Phaser API Documentation

  Version: 
parseFrame(key)

Description:

Parses the 'key' parameter and returns a Texture Frame instance.

It can accept the following formats:

  1. A string
  2. An array where the elements are: [ key, [frame] ]
  3. An object with the properties: { key, [frame] }
  4. A Texture instance - which returns the default frame from the Texture
  5. A Frame instance - returns itself

Parameters:

name type description
key string | array | object | Phaser.Textures.Texture | Phaser.Textures.Frame

The key to be parsed.

Returns:
Description:

A Texture Frame object, if found, or undefined if not.

Since: 3.60.0