BuckarooBanzay 206807a9ca
Some checks failed
luacheck / luacheck (push) Has been cancelled
test / test (push) Has been cancelled
fix tab issue in color definition
2024-06-21 08:17:08 +02:00
ci
2024-05-21 21:37:20 +02:00
2024-05-22 10:35:56 +02:00
2024-06-06 13:39:14 +02:00
2024-05-23 10:00:20 +02:00
2024-05-23 09:44:02 +02:00
2024-06-21 08:17:08 +02:00
2024-05-22 10:32:27 +02:00
2024-05-23 10:00:20 +02:00
2024-06-06 19:12:15 +02:00
2024-05-23 09:31:49 +02:00
2024-05-21 21:02:25 +02:00
we
2024-05-21 21:04:20 +02:00
2024-05-21 21:27:35 +02:00
2024-05-21 21:47:27 +02:00

isogen

License Download Coverage Status

Generate isometric images from ingame builds

Commands

If the worldedit mod is present you can use the following command to render the current we-region to a png-file:

//isogen [filename]

NOTE: larger regions require more memory

Colors

Supported node-colors:

  • colors.txt files in the /colors directory
  • palette-support for unifieddyes_palette_extended
  • mapcolor node definition
  • colors.txt file in the world-directory (if found)

Api

isogen.draw(pos1, pos2, opts?)

Renders an isometric image and returns the png data

Example:

local pos1 = vector.new(0,0,0)
local pos2 = vector.new(16,16,16) -- NOTE: larger regions require more memory
local opts = { -- optional
    cube_len = 24, -- optional: multiple of 4 and greater than 4 pixels
    enable_transparency = false, -- optional/experimental: enable transparency
    get_node = minetest.get_node -- optional: the get_node() function to use
}

-- render and save to world-directory
local png = isogen.draw(pos1, pos2, opts)
local path = minetest.get_worldpath() .. "/iso.png"
minetest.safe_file_write(path, png)

isogen.draw_map(pos1, pos2, opts?)

Renders a map image and returns the png data

Example:

local pos1 = vector.new(0,0,0)
local pos2 = vector.new(16,16,16) -- NOTE: larger regions require more memory
local opts = { -- optional
    get_node = minetest.get_node -- optional: the get_node() function to use
}

-- render and save to world-directory
local png = isogen.draw_map(pos1, pos2, opts)
local path = minetest.get_worldpath() .. "/map.png"
minetest.safe_file_write(path, png)

isogen.create_canvas(width, height)

Creates a canvas to set and get pixels

Example:

-- create a canvas, draw a pixel on the coords 0,0 and save the png to the world-directory
local c = isogen.create_canvas(240, 160)
c:set_pixel(0, 0, { r=255, g=0, b=0, a=0 })

local png = c:png()
local path = minetest.get_worldpath() .. "/iso.png"
minetest.safe_file_write(path, png)

License

  • Code: MIT
Description
No description provided
Readme 402 KiB
Languages
Lua 95%
Go 5%