This is the third rework of Nene (see #17), this time, less breaking than the previous rework, but some changes are hopefully for the better, this is the changelog:
- License changed from MIT to Zlib, just as SDL2.
- Now nene uses the singleton pattern, which means you can use
Nene.instance()
function any type to get the nene instance, instead of passing it by parameter. - All modules uses the newer module system of nelua, just as Lua, you require the modules as
local Nene = require 'nene'
- Removed
core.nelua
file, now, just requiring"nene"
will return the main nene module only, instead of requiring all modules as before - The SDL's wrappers are removed, now nene just calls and handle SDL directly.
- SDL libraries updated to latest ones provided by
nelua-decl
. - All modules that wraps a SDL type will contain a
get_raw
method, which returns the wrapped value (with anilptr
check), for instance, nene uses the term "raw" to refer to any wrapped type, especially the SDL ones. - The nene's math module is now split between various modules like
nene.math.vec2
, one module for each type, however, the general math module is still provided and is not considered deprecated. - Now it's possible to use any arithmetic type for 2D vectors and rectangles using
Vec2n
andRectn
types, for instance,Vec2
,Rect
andRectf
are respectivelyVec2n(number)
,Rectn(integer)
andRectn(number)
. - As the math module, the
Audio
module got split betweenSound
andMusic
modules, while theAudio
wraps both. - All "destroyable" types implements the
__close
metamethod, including the main nene module. - Some font metrics are added to
Font
module. - Text rendering on
TextTexture
module it's stillsolid
by default, but now it's possible to useblended
render mode, which is much better for non-pixel-art fonts. - Previously some functions that returned an
value, ok_status
now returnsok_status, value
, this is done to enforce if the function run successfully. - All the examples and documentation updated