IDE-helper: add descriptions for Entity class

This commit is contained in:
alek13
2024-09-09 21:54:13 +03:00
parent 9a7a1dc64a
commit 491335f66b
2 changed files with 56 additions and 39 deletions

View File

@@ -1,43 +1,55 @@
---@class Entity: ObjectRef ---@class Entity: ObjectRef
Entity = {} Entity = {}
--TODO: --- Removes object.
--* `remove()`: remove object --- * The object is removed after returning from Lua. However the `ObjectRef`
--* The object is removed after returning from Lua. However the `ObjectRef` --- itself instantly becomes unusable with all further method calls having
--itself instantly becomes unusable with all further method calls having --- no effect and returning `nil`.
--no effect and returning `nil`. function Entity:remove() end
--- @param vel vector e.g. `{x=0.0, y=2.3, z=1.0}`
function Entity:set_velocity(vel) end function Entity:set_velocity(vel) end
--* `vel` is a vector, e.g. `{x=0.0, y=2.3, z=1.0}` --- @param acc vector
--* `set_acceleration(acc)` function Entity:set_acceleration(acc) end
--* `acc` is a vector --- Returns the acceleration, a vector.
--* `get_acceleration()`: returns the acceleration, a vector --- @return vector
--* `set_rotation(rot)` function Entity:get_acceleration() end
--* `rot` is a vector (radians). X is pitch (elevation), Y is yaw (heading) --- Remove & readd your objects to force a certain rotation.
--and Z is roll (bank). --- Does not reset rotation incurred through `automatic_rotate`.
--* Does not reset rotation incurred through `automatic_rotate`. --- @param rot vector (radians). X is pitch (elevation), Y is yaw (heading) and Z is roll (bank).
--Remove & readd your objects to force a certain rotation. function Entity:set_rotation(rot) end
--* `get_rotation()`: returns the rotation, a vector (radians) --- Returns the rotation, a vector (radians).
--* `set_yaw(yaw)`: sets the yaw in radians (heading). --- @return vector
--* `get_yaw()`: returns number in radians function Entity:get_rotation() end
--* `set_texture_mod(mod)` --- Sets the yaw in radians (heading).
--* Set a texture modifier to the base texture, for sprites and meshes. --- @param yaw number
--* When calling `set_texture_mod` again, the previous one is discarded. function Entity:set_yaw(yaw) end
--* `mod` the texture modifier. See [Texture modifiers]. --- Returns number in radians.
--* `get_texture_mod()` returns current texture modifier --- @return number
--* `set_sprite(start_frame, num_frames, framelength, select_x_by_camera)` function Entity:get_yaw() end
--* Specifies and starts a sprite animation --- Set a texture modifier to the base texture, for sprites and meshes.
--* Animations iterate along the frame `y` position. --- When calling `set_texture_mod` again, the previous one is discarded.
--* `start_frame`: {x=column number, y=row number}, the coordinate of the --- @param mod string|TextureModifier the texture modifier. See [Texture modifiers].
--first frame, default: `{x=0, y=0}` function Entity:set_texture_mod(mod) end
--* `num_frames`: Total frames in the texture, default: `1` --- Returns current texture modifier.
--* `framelength`: Time per animated frame in seconds, default: `0.2` --- @return string|TextureModifier
--* `select_x_by_camera`: Only for visual = `sprite`. Changes the frame `x` function Entity:get_texture_mod() end
--position according to the view direction. default: `false`. --- Specifies and starts a sprite animation.
--* First column: subject facing the camera --- Only used by `sprite` and `upright_sprite` visuals.
--* Second column: subject looking to the left --- Animations iterate along the frame `y` position.
--* Third column: subject backing the camera --- @param start_frame {x:number,y:number} {x=column number, y=row number}, the coordinate of the first frame, default: `{x=0, y=0}`
--* Fourth column: subject looking to the right --- @param num_frames number Total frames in the texture, default: `1`
--* Fifth column: subject viewed from above --- @param framelength number Time per animated frame in seconds, default: `0.2`
--* Sixth column: subject viewed from below --- @param select_x_by_camera boolean Only for visual = `sprite`. Changes the frame `x`position according to the view direction. default: `false`.
--* `get_entity_name()` (**Deprecated**: Will be removed in a future version, use the field `self.name` instead) --- First column: subject facing the camera
--* `get_luaentity()` --- Second column: subject looking to the left
--- Third column: subject backing the camera
--- Fourth column: subject looking to the right
--- Fifth column: subject viewed from above
--- Sixth column: subject viewed from below
function Entity:set_sprite(start_frame, num_frames, framelength, select_x_by_camera) end
--- (**Deprecated**: Will be removed in a future version, use the field `self.name` instead)
--- @deprecated
--- @return string
function Entity:get_entity_name() end
--- @return LuaEntity
function Entity:get_luaentity() end

View File

@@ -0,0 +1,5 @@
--- **Texture overlaying:** `^`.
--- **Texture grouping:** `(` and `)`.
--- See more: https://api.minetest.net/textures/#texture-modifiers
--- @class TextureModifier: string