# How to know if a Texture and Texture Canvas is ready?

**URL:** <https://forum.babylonjs.com/t/how-to-know-if-a-texture-and-texture-canvas-is-ready/26444>\
**Category:** Questions\
**Created:** [January 4, 2022, 2:59am UTC](https://forum.babylonjs.com/t/how-to-know-if-a-texture-and-texture-canvas-is-ready/26444 "2022-01-04T02:59:42Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![\_Cri5](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/_cri5/32/13066_2.png) [@\_Cri5](https://forum.babylonjs.com/u/_Cri5)\
**Post date:** [January 4, 2022, 2:59am UTC](https://forum.babylonjs.com/t/how-to-know-if-a-texture-and-texture-canvas-is-ready/26444/1 "2022-01-04T02:59:42Z")

</div>

For example here [https://playground.babylonjs.com/#9S5YZY#6](https://playground.babylonjs.com/#9S5YZY#6)

Is there a way to run code/function after a Texture is ready and the context of the Texture Canvas is ready to draw?

I have done it with SetTimeout by waiting some miliseconds and then running it but I feel like it is “unsafe” or unreliable and there should be a better way to do it.

---

<div class="post-metadata">

**Author:** ![labris](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/labris/32/12576_2.png) [@labris](https://forum.babylonjs.com/u/labris)\
**Post date:** [January 4, 2022, 3:06am UTC](https://forum.babylonjs.com/t/how-to-know-if-a-texture-and-texture-canvas-is-ready/26444/2 "2022-01-04T03:06:28Z")

</div>

You may try  
`texture.isReady`  
(Get if the texture is ready to be used (downloaded, converted, mip mapped…).

or  
`texture.isReadyOrNotBlocking`  
(Get if the texture is ready to be consumed (either it is ready or it is not blocking))

Both will return `true` or `false`.

See API - [Texture | Babylon.js Documentation](https://doc.babylonjs.com/typedoc/classes/babylon.texture#isready)

---

<div class="post-metadata">

**Author:** ![\_Cri5](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/_cri5/32/13066_2.png) [@\_Cri5](https://forum.babylonjs.com/u/_Cri5)\
**Post date:** [January 4, 2022, 6:43am UTC](https://forum.babylonjs.com/t/how-to-know-if-a-texture-and-texture-canvas-is-ready/26444/3 "2022-01-04T06:43:10Z")

</div>

I think I figured it out.

In the case of the Texture there is this “onLoadObservable” similar to “onPointerObservable” that “triggers” when it is ready.

The Texture Canvas also has a onLoadObservable but I don’t know. It seems like it doesn’t work?
