Custom Textures
Last updated
Was this helpful?
Last updated
Was this helpful?
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:
Let's analyze it, we created a register function (more info in ), 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:
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.