Add API for getting the drawable order of a given drawable.

This commit is contained in:
Karishma Chadha
2018-07-24 11:05:38 -04:00
parent b753c37899
commit 11671ee885

View File

@@ -474,6 +474,16 @@ class RenderWebGL extends EventEmitter {
}
}
/**
* Returns the position of the given drawableID in the draw list. This is
* the absolute position irrespective of layer group.
* @param {number} drawableID The drawable ID to find.
* @return {number} The postion of the given drawable ID.
*/
getDrawableOrder (drawableID) {
return this._drawList.indexOf(drawableID);
}
/**
* Set a drawable's order in the drawable list (effectively, z/layer).
* Can be used to move drawables to absolute positions in the list,