# engineIsAssetLoaded (Client)

> Tells whether an asset a script made is ready to use.

- **Platform**: MY Multiplayer (MYMP)
- **Kind**: Lua Function
- **Side**: Client
- **Category**: Textures
- **URL**: https://wiki.mymp.gg/en/engineIsAssetLoaded

## Syntax

```lua
bool engineIsAssetLoaded(element asset)
```

## Parameters

| Name | Type | Description |
| --- | --- | --- |
| `asset` | `element` | A `txd`, `texture` (or other image), `shader`, `material`, `model`, `drawable` or `col` element. |

## Returns

`true` when it is ready. Raises an error if the element is not a txd, texture, shader, material, model, drawable or col.

A txd is ready once its file is read (`engineCreateTxd` makes one ready at once), an image once its texture is built, and a shader once it has compiled. A `model` element is ready while its model is streamed in. A `drawable`, a `col` and a `material` are always ready.

## Example

```lua
local logo = engineCreateTexture("images/logo.png")

addEventHandler("onClientRender", root, function()
    if engineIsAssetLoaded(logo) then
        dxDrawImage(20, 20, 128, 128, logo)
    end
end)
```

## See also

- [onClientAssetLoad (Client)](https://wiki.mymp.gg/en/onClientAssetLoad.md): Fired once when an asset a script started loading in the background is ready, or has failed.
- [engineLoadTxd (Client)](https://wiki.mymp.gg/en/engineLoadTxd.md): Loads a texture dictionary (.ktd) from a resource file under a name. It exists on this client only.
- [engineCreateTexture (Client)](https://wiki.mymp.gg/en/engineCreateTexture.md): Creates a texture from an image file in the resource or from image bytes in memory. The texture exists on this client only.
- [engineCreateShader (Client)](https://wiki.mymp.gg/en/engineCreateShader.md): Creates a shader from a .shader file or from its source text. The shader compiles in the background.
