Page 1 of 1

Lovelas - LÖVE texture atLAS creator

Posted: Fri Dec 09, 2022 9:18 pm
by coz
Just updated the library at viewtopic.php?f=5&t=80558 and released with the author's permission under MIT at
https://notabug.org/coz/Lovelas

Lovelas: texture atlas generation library for LÖVE

Notes on usage:
  • Include atlas.lua somewhere in your project
  • Require it
  • Create new atlas object using Atlas() or AtlasCL() (Command Line version) functions:

Code: Select all

atlas = Atlas(w, h, po2, path, file, info, silent)
where:
  • w, h: starting width and height of image (1x1 by default)
  • po2 - if true then create power of two sized image (true by default)
  • path - path to images' folder (without recursion and format checking yet)
  • file - name of output files (image and text file with coordinates), will be created in save directory of project
  • info - if true then output some info to console
  • silent - if true then exit after atlas creation
example:

Code: Select all

atlas = Atlas(32, 32, true, "images", "atlas01", true, false) -- atlas01.png and atlas01.txt will be created
If you omit path to images, then you should use atlas.build(path) function later. You can also use atlas.out(filename, format) function to save atlas.

If you don't want to create output files but use it internally then:
  • atlas.map contains the image itself
  • atlas.uv - coords