:`
* `` = animation frame count
* `` = current animation frame
Draw a step of the crack animation on the texture.
Example:
default_cobble.png^[crack:10:1
#### `[combine:x:,=:,=:...`
* `` = width
* `` = height
* `` = x position
* `` = y position
* `` = texture to combine
Creates a texture of size `` times `` and blits the listed files to their
specified coordinates.
Example:
[combine:16x32:0,0=default_cobble.png:0,16=default_wood.png
#### `[brighten`
Brightens the texture.
Example:
tnt_tnt_side.png^[brighten
#### `[noalpha`
Makes the texture completely opaque.
Example:
default_leaves.png^[noalpha
#### `[makealpha:,,`
Convert one color to transparency.
Example:
default_cobble.png^[makealpha:128,128,128
#### `[transform`
* `` = transformation(s) to apply
Rotates and/or flips the image.
`` can be a number (between 0 and 7) or a transform name.
Rotations are counter-clockwise.
0 I identity
1 R90 rotate by 90 degrees
2 R180 rotate by 180 degrees
3 R270 rotate by 270 degrees
4 FX flip X
5 FXR90 flip X then rotate by 90 degrees
6 FY flip Y
7 FYR90 flip Y then rotate by 90 degrees
Example:
default_stone.png^[transformFXR90
#### `[inventorycube{{{`
`^` is replaced by `&` in texture names.
Create an inventory cube texture using the side textures.
Example:
[inventorycube{grass.png{dirt.png&grass_side.png{dirt.png&grass_side.png
Creates an inventorycube with `grass.png`, `dirt.png^grass_side.png` and
`dirt.png^grass_side.png` textures
#### `[lowpart::`
Blit the lower ``% part of `` on the texture.
Example:
base.png^[lowpart:25:overlay.png
#### `[verticalframe::`
* `` = animation frame count
* `` = current animation frame
Crops the texture to a frame of a vertical animation.
Example:
default_torch_animated.png^[verticalframe:16:8
#### `[mask:`
Apply a mask to the base image.
The mask is applied using binary AND.
#### `[colorize::`
Colorize the textures with the given color.
`` is specified as a `ColorString`.
`` is an int ranging from 0 to 255, and specifies how much of the
color to apply. If ommitted, the alpha will be used.
Sounds
------
Only Ogg Vorbis files are supported.
For positional playing of sounds, only single-channel (mono) files are
supported. Otherwise OpenAL will play them non-positionally.
Mods should generally prefix their sounds with `modname_`, e.g. given
the mod name "`foomod`", a sound could be called:
foomod_foosound.ogg
Sounds are referred to by their name with a dot, a single digit and the
file extension stripped out. When a sound is played, the actual sound file
is chosen randomly from the matching sounds.
When playing the sound `foomod_foosound`, the sound is chosen randomly
from the available ones of the following files:
* `foomod_foosound.ogg`
* `foomod_foosound.0.ogg`
* `foomod_foosound.1.ogg`
* (...)
* `foomod_foosound.9.ogg`
Examples of sound parameter tables:
-- Play location-less on all clients
{
gain = 1.0, -- default
}
-- Play location-less to a player
{
to_player = name,
gain = 1.0, -- default
}
-- Play in a location
{
pos = {x=1,y=2,z=3},
gain = 1.0, -- default
max_hear_distance = 32, -- default, uses an euclidean metric
}
-- Play connected to an object, looped
{
object = ,
gain = 1.0, -- default
max_hear_distance = 32, -- default, uses an euclidean metric
loop = true, -- only sounds connected to objects can be looped
}
### `SimpleSoundSpec`
* e.g. `""`
* e.g. `"default_place_node"`
* e.g. `{}`
* e.g. `{name="default_place_node"}`
* e.g. `{name="default_place_node", gain=1.0}`
Registered definitions of stuff
-------------------------------
Anything added using certain `minetest.register_*` functions get added to
the global `minetest.registered_*` tables.
* `minetest.register_entity(name, prototype table)`
* added to `minetest.registered_entities[name]`
* `minetest.register_node(name, node definition)`
* added to `minetest.registered_items[name]`
* added to `minetest.registered_nodes[name]`
* `minetest.register_tool(name, item definition)`
* added to `minetest.registered_items[name]`
* `minetest.register_craftitem(name, item definition)`
* added to `minetest.registered_items[name]`
* `minetest.register_biome(biome definition)`
* returns an integer uniquely identifying the registered biome
* added to `minetest.registered_biome` with the key of `biome.name`
* if `biome.name` is nil, the key is the returned ID
* `minetest.register_ore(ore definition)`
* returns an integer uniquely identifying the registered ore
* added to `minetest.registered_ores` with the key of `ore.name`
* if `ore.name` is nil, the key is the returned ID
* `minetest.register_decoration(decoration definition)`
* returns an integer uniquely identifying the registered decoration
* added to `minetest.registered_decorations` with the key of `decoration.name`
* if `decoration.name` is nil, the key is the returned ID
* `minetest.register_schematic(schematic definition)`
* returns an integer uniquely identifying the registered schematic
* added to `minetest.registered_schematic` with the key of `schematic.name`
* if `schematic.name` is nil, the key is the returned ID
* if the schematic is loaded from a file, schematic.name is set to the filename
* if the function is called when loading the mod, and schematic.name is a relative path,
* then the current mod path will be prepended to the schematic filename
* `minetest.clear_registered_biomes()`
* clears all biomes currently registered
* `minetest.clear_registered_ores()`
* clears all ores currently registered
* `minetest.clear_registered_decorations()`
* clears all decorations currently registered
* `minetest.clear_registered_schematics()`
* clears all schematics currently registered
Note that in some cases you will stumble upon things that are not contained
in these tables (e.g. when a mod has been removed). Always check for
existence before trying to access the fields.
Example: If you want to check the drawtype of a node, you could do:
local function get_nodedef_field(nodename, fieldname)
if not minetest.registered_nodes[nodename] then
return nil
end
return minetest.registered_nodes[nodename][fieldname]
end
local drawtype = get_nodedef_field(nodename, "drawtype")
Example: `minetest.get_item_group(name, group)` has been implemented as:
function minetest.get_item_group(name, group)
if not minetest.registered_items[name] or not
minetest.registered_items[name].groups[group] then
return 0
end
return minetest.registered_items[name].groups[group]
end
Nodes
-----
Nodes are the bulk data of the world: cubes and other things that take the
space of a cube. Huge amounts of them are handled efficiently, but they
are quite static.
The definition of a node is stored and can be accessed by name in
minetest.registered_nodes[node.name]
See "Registered definitions of stuff".
Nodes are passed by value between Lua and the engine.
They are represented by a table:
{name="name", param1=num, param2=num}
`param1` and `param2` are 8-bit integers. The engine uses them for certain
automated functions. If you don't use these functions, you can use them to
store arbitrary values.
The functions of `param1` and `param2` are determined by certain fields in the
node definition:
`param1` is reserved for the engine when `paramtype != "none"`:
paramtype = "light"
^ The value stores light with and without sun in its upper and lower 4 bits
respectively. Allows light to propagate from or through the node with
light value falling by 1 per node. This is essential for a light source
node to spread its light.
`param2` is reserved for the engine when any of these are used:
liquidtype == "flowing"
^ The level and some flags of the liquid is stored in param2
drawtype == "flowingliquid"
^ The drawn liqu
ENDIF ()
ENDIF(APPLE)
ENDIF (WIN32)
#SET( OPENGLES2_LIBRARIES ${OPENGLES2_gl_LIBRARY} ${OPENGLES2_LIBRARIES})
IF (BUILD_ANDROID)
IF(OPENGLES2_gl_LIBRARY)
SET( OPENGLES2_LIBRARIES ${OPENGLES2_gl_LIBRARY} ${OPENGLES2_LIBRARIES})
SET( EGL_LIBRARIES)
SET( OPENGLES2_FOUND "YES" )
ENDIF(OPENGLES2_gl_LIBRARY)
ELSE ()
SET( OPENGLES2_LIBRARIES ${OPENGLES2_gl_LIBRARY} ${OPENGLES2_LIBRARIES})
IF(OPENGLES2_gl_LIBRARY AND EGL_egl_LIBRARY)
SET( OPENGLES2_LIBRARIES ${OPENGLES2_gl_LIBRARY} ${OPENGLES2_LIBRARIES})
SET( EGL_LIBRARIES ${EGL_egl_LIBRARY} ${EGL_LIBRARIES})
SET( OPENGLES2_FOUND "YES" )
ENDIF(OPENGLES2_gl_LIBRARY AND EGL_egl_LIBRARY)
ENDIF ()
MARK_AS_ADVANCED(
OPENGLES2_INCLUDE_DIR
OPENGLES2_gl_LIBRARY
EGL_INCLUDE_DIR
EGL_egl_LIBRARY
)
IF(OPENGLES2_FOUND)
MESSAGE(STATUS "Found system opengles2 library ${OPENGLES2_LIBRARIES}")
ELSE ()
SET(OPENGLES2_LIBRARIES "")
ENDIF ()