Skip to content

Textures documentation

Peter Crew edited this page Jan 4, 2019 · 2 revisions

This page covers the TextureRegistry, Texture, and ParticleTexture classes.


TextureRegistry

This purely static class is used to load textures from the assets/texture sub-directory within a mod's folder.

Methods

Name Arguments Return type Description
load String Texture Uses the Equilinox texture loader to load the given PNG texture from the mod's assets.
load String, {} Texture Uses the Equilinox texture loader to load the given PNG texture from the mod's assets, loading with the settings provided by the settings object.

Settings object for load

The overloaded method for load takes a JavaScript object which can have the following properties:

Name Type Description
clampEdges boolean Determines whether the edges of the texture should be clamped.
nearestFiltering boolean Determines whether nearest-neighbour filtering should be applied to the texture.
noFiltering boolean Determines whether any filtering should be applied to the texture.
noMipMap boolean Determines whether mip-mapping should be disabled for the texture.

Texture

Represents an in-game texture that has been loaded by the Equilinox system.

Methods

Name Arguments Return type Description
isLoaded None boolean Returns true if the texture has been fully loaded.
getID None int Returns the internal OpenGL texture handle for the texture.
delete None void Requests that the texture be deleted as soon as possible.

ParticleTexture

Represents an in-game texture atlas used for a particle system.

Constructor

The constructor takes three arguments: a Texture, an int, and a boolean. The texture defines the actual texture that is rendered, the int states how many rows there are in the atlas (the number of rows has to equal the number of columns as well), and the boolean states whether additive blending is used.

For example, new ParticleTexture(TextureRegistry.load("test.png"), 3, true) loads the test.png texture (which has 3 rows and columns) with additive blending.

Methods

Name Arguments Return type Description
setGlowy None ParticleTexture Sets the particle texture to have a glow effect, and returns the object for chaining.
glows None boolean Returns true if the texture has a glow effect.
Clone this wiki locally