Natiny 0.14.0
Particle systems add flexible effects, script hosting supports mods and headless servers, and the new view module builds responsive interfaces.
Natiny 0.14.0 brings particle effects into the engine, lets games host isolated scripts, and makes interfaces settle faster. The same runtime can now power a windowed game, a headless server, or a tool without carrying unused systems.
Particle effects are now engine objects
Fire, smoke, rain, sparks, and debris can now be built with the
natiny_particles_* API. An emitter is an entity, so it can be positioned
normally or parented to a model, body, or bone. Emission shapes, bursts, lifetime
ranges, gravity, damping, colour and size curves, flipbooks, and several
billboard modes cover both 2D and 3D effects without a callback for every
particle.
In 3D, particle systems join ordinary models in the material-tag render pass
and its sorting. In 2D they are drawn explicitly with
natiny_render_particles. The
particle effects guide builds a
campfire from first emitter to finished flames, smoke, and sparks.
Instanced materials arrive with the same update. Consecutive models that share a mesh, textures, and an instanced material are folded into one draw while keeping their own transform, colour, and animation pose. The same NSL shader source produces the ordinary, skinned, and instanced forms.
Games can host scripts and run without graphics
Scripting is now part of the native engine API. A host can create an isolated script, choose exactly which Natiny modules it may use, exchange values and callbacks with it, and run source loaded from either loose files or asset packs. Games can use the same system for level scripts, downloadable content, tools, or mods; the running a script guide covers the complete flow.
The safe standard library leaves out filesystem, operating-system, debugger,
and native-library access, while require() continues to read through the
mounted resource stack. This is a useful boundary for mods, though any engine
handle deliberately handed to a script remains usable by it.
natiny_backend_init(NATINY_BACKEND_NONE) now
runs the main loop without a window or graphics device. Physics, audio,
animation, resources, and scripts keep running, making the same engine suitable
for servers, tools, and automated tests. Existing projects still start and run
as before.
view builds responsive interfaces
The new view module builds interfaces from rectangles that size and place
themselves. A parent can arrange its children freely, vertically,
horizontally, in the centre, or on a grid; padding and gaps belong to the
parent, while each child states its minimum, maximum, margin, and whether it
should take spare space.
NatinyView page = natiny_view_create(NATINY_LAYOUT_VERTICAL);
NatinyView toolbar = natiny_view_create(NATINY_LAYOUT_HORIZONTAL);
NatinyView content = natiny_view_create(NATINY_LAYOUT_FREE);
natiny_view_set_parent(toolbar, page);
natiny_view_set_parent(content, page);
natiny_view_set_expand(content, true);
Rows and columns handle both extra room and shortages in one pass. Nested
interfaces therefore settle on the first frame when a window or divider
moves, and a button that changes the layout shows the result in the same frame
as the click. Call
natiny_render_view with the available
rectangle to lay out the tree, dispatch pointer hooks, and draw it.
Pointer behaviour follows desktop controls: presses are captured until release, clicks bubble from labels to their buttons, and non-pickable views let input pass through. Views can also own focus, clip both drawing and picking, and read normalized mouse-wheel movement. Drawing remains application-defined through hooks, so the module provides layout and interaction without imposing a widget style.
The rendering underneath has been tightened for those interfaces too. Rounded shapes and circles now have smooth edges at small and large sizes, while shapes and text batch together across controls instead of turning each label into another draw call.
Material tags can now be listed and removed as well as added. The native API
provides natiny_material_add_tag,
natiny_material_get_tag_count,
natiny_material_get_tag, and
natiny_material_remove_tag.
natiny_material_has_tag() and its Lua equivalent have been removed; code
that tests for a tag should walk the material's tag list instead.
Natiny 0.14.0 bundles for every supported platform are on the download page.