Update docs/dev/Lua API.rst

Co-authored-by: Myk <myk.taylor@gmail.com>
develop
shevernitskiy 2023-08-30 12:48:36 +03:00 committed by GitHub
parent b3d423b8a4
commit 13e0a49eef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

@ -2606,8 +2606,9 @@ graphical tile id passed as the ``tile`` field in a `Pen <lua-screen-pen>`).
Adding new textures to the vector is not difficult, but the game periodically Adding new textures to the vector is not difficult, but the game periodically
deletes textures that are in the vector, and that's a problem since it deletes textures that are in the vector, and that's a problem since it
invalidates the ``texpos`` value that used to point to that texture. invalidates the ``texpos`` value that used to point to that texture.
The ``texture`` module solves this problem. Instead of ``texpos`` directly, it operates on the ``TexposHandle`` entity, which is essentially a reference to ``texpos``. The ``textures`` module solves this problem by providing a stable handle instead of a
Thanks to this handle, it is possible to get a valid ``texpos`` at any time. raw ``texpos``. When we need to draw a particular tile, we can look up the current
``texpos`` value via the handle.
* ``loadTileset(file, tile_px_w, tile_px_h)`` * ``loadTileset(file, tile_px_w, tile_px_h)``