Skip to content

03 User Defined Texture (TBD)

Lavi22 edited this page Sep 8, 2019 · 1 revision

In this section, we will demonstrate how to put custom textures into DMLab.

Introduction

The textures we can change include the interior (wall, floor, sky) and reward object. First of all, we must have the textures we want to add in .tga format. There are plenty of tools that are able to transform .jpg or .png files to .tga files such as PIL.

Interior

Put the .tga files into lab/assets/textures/map/ then define your own texture set in lab/game_scripts/themes/texture_sets.lua. When everything is well prepared, we have to include the new texture set into our level.

Let's say we want our wall as tab_brown.tga, floor as tab_green.tga, and sky as tab_blue.tga. We must put them under lab/assets/textures/map/dmlab_practice/, then add the following scripts before return.

texture_sets.PRACTICE = {
    floor = {{tex = 'map/dmlab_practice/tab_green'}},
    ceiling = {{tex = 'map/dmlab_practice/tab_blue'}},
    wall = {{tex = 'map/dmlab_practice/tab_brown'}},
}

Next, we have to include it into our script.

Clone this wiki locally