Phaser API Documentation

  Version: 
getTextureSourceIndex(source)

Description:

Takes the given TextureSource and returns the index of it within this Texture. If it's not in this Texture, it returns -1. Unless this Texture has multiple TextureSources, such as with a multi-atlas, this method will always return zero or -1.

Parameters:

name type description
source Phaser.Textures.TextureSource

The TextureSource to check.

Returns:
Description:

The index of the TextureSource within this Texture, or -1 if not in this Texture.

Type:
  • number
Examples:
Since: 3.0.0
Source: src/textures/Texture.js (Line 259)