> For the complete documentation index, see [llms.txt](https://zenith391.gitbook.io/exdilin/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://zenith391.gitbook.io/exdilin/lua-mods/custom-textures.md).

# Custom Textures

First we need to choose a name for the texture, we'll just go by Test Texture.

Now you just have to take some image and save it as a PNG file in the mod directory. Let's say our file is named `test.png`. We'll do this:

```lua
-- ... previous code

function register(registerType)
    if registerType == "textures" then
        exdilin.register_and_load_texture("Test Texture", "test.png", "Normal", "OneSideTo1x1")
    end
end
```

Let's analyze it, we created a register function (more info in [Initialization orders](/exdilin/concepts/initialization-orders.md)), then using an if "block", we check if we are currently registering textures (if we're not, we do nothing, you don't want to make textures while the game is making blocks?).

Then, the `exdilin.register_and_load_texture` function (which has a long name) has 4 arguments: The first is the name of the texture, as we said above it is Test Texture.\
The second is the file of the texture, we saved the image as `test.png`, so that's what we put here.\
The third is the texture type, it's a `Normal` texture.\
The fourth and final is the texture thing, which here is `OneSideTo1x1` (which means the texture only shows to one side of a block).

The last step is to make the texture available in the build panel:

```lua
-- ... previous code

function pre_init()
    -- whatever code you had in here too
    exdilin.texture_item("Test Texture").register()
end
```

Nothing complex here, `exdilin.texture_item` takes the name of the texture, and then we use the `register()` function. This is like we do for block items except here it is texture items.
