Skip to content

Texture functions

define_texture

source

function define_texture(texture_data: TextureDefinition): TEXTURE
texture_data: TextureDefinition

Returns TEXTURE

Defines a new texture that can be used in Entity::set_texture If a texture with the same definition already exists the texture will be reloaded from disk.

get_texture

source

function get_texture(texture_data: TextureDefinition): TEXTURE?
texture_data: TextureDefinition

Returns TEXTURE? (may be nil)

Gets a texture with the same definition as the given, if none exists returns nil

get_texture_definition

source

function get_texture_definition(texture_id: TEXTURE): TextureDefinition
texture_id: TEXTURE

Returns TextureDefinition

Gets a TextureDefinition for equivalent to the one used to define the texture with id

reload_texture

source

function reload_texture(texture_path: string)
texture_path: string

Reloads a texture from disk, use this only as a development tool for example in the console Note that define_texture will also reload the texture if it already exists

replace_texture

source

function replace_texture(vanilla_id: TEXTURE, custom_id: TEXTURE): boolean
vanilla_id: TEXTURE
custom_id: TEXTURE

Returns boolean

Replace a vanilla texture definition with a custom texture definition and reload the texture.

replace_texture_and_heart_color

source

function replace_texture_and_heart_color(vanilla_id: TEXTURE, custom_id: TEXTURE): boolean
vanilla_id: TEXTURE
custom_id: TEXTURE

Returns boolean

Replace a vanilla texture definition with a custom texture definition and reload the texture. Set corresponding character heart color to the pixel in the center of the player indicator arrow in that texture. (448,1472)

reset_lut

source

function reset_lut(layer: LAYER)
layer: LAYER

Same as set_lut(nil, layer)

reset_texture

source

function reset_texture(vanilla_id: TEXTURE)
vanilla_id: TEXTURE

Reset a replaced vanilla texture to the original and reload the texture.

set_lut

source

function set_lut(texture_id: TEXTURE?, layer: LAYER)
texture_id: TEXTURE?
layer: LAYER

Force the LUT texture for the given layer (or both) until it is reset. Pass nil in the first parameter to reset