maprenderer

package module
v1.0.23 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 23, 2024 License: MIT Imports: 5 Imported by: 0

README

Minetest map renderer go-library and cli

Coverage Status

Usage

# show help and usage
./maprenderer -help

Isometric map

./maprenderer -world /home/user/.minetest/worlds/myworld/ -from -200,-50,-200 -to 200,100,200 -type isometric

Example output:

Flat map

./maprenderer -world /home/user/.minetest/worlds/myworld/ -from -200,-50,-200 -to 200,100,200 -type map

Binary downloads

See: https://github.com/minetest-go/maprenderer/releases

License

Code: MIT

Other assets

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BlendColor added in v1.0.21

func BlendColor(bg, fg *color.RGBA, bf float64) *color.RGBA

func ColorAdjust added in v1.0.21

func ColorAdjust(c *color.RGBA, value int) *color.RGBA

func DrawIsoCube added in v1.0.21

func DrawIsoCube(img *image.RGBA, cube_len, x_offset, y_offset int, c1, c2, c3 color.Color) error

func GetIsoCenterCubeOffset added in v1.0.21

func GetIsoCenterCubeOffset(size *types.Pos, cube_len int) (int, int)

func GetIsoCubePosition added in v1.0.21

func GetIsoCubePosition(center_x, center_y, cube_len int, pos *types.Pos) (int, int)

func GetIsoNodeOrder added in v1.0.21

func GetIsoNodeOrder(p *types.Pos) int

func GetIsometricImageSize added in v1.0.21

func GetIsometricImageSize(size *types.Pos, cube_len int) (int, int)

func RenderIsometric added in v1.0.21

func RenderIsometric(na types.NodeAccessor, cr types.ColorResolver, from, to *types.Pos, opts *IsoRenderOpts) (image.Image, error)

func RenderMap added in v1.0.21

func RenderMap(na types.NodeAccessor, cr types.ColorResolver, from, to *types.Pos, opts *MapRenderOpts) (*image.NRGBA, error)

Types

type IsoRenderOpts added in v1.0.21

type IsoRenderOpts struct {
	CubeLen            int
	EnableTransparency bool
}

func NewDefaultIsoRenderOpts added in v1.0.21

func NewDefaultIsoRenderOpts() *IsoRenderOpts

type MapRenderOpts added in v1.0.21

type MapRenderOpts struct {
}

func NewDefaultMapRenderOpts added in v1.0.21

func NewDefaultMapRenderOpts() *MapRenderOpts

type NodeWithColor added in v1.0.21

type NodeWithColor struct {
	*types.Node
	Color *color.RGBA
}

func Probe added in v1.0.21

func Probe(min, max, pos, ipos *types.Pos, na types.NodeAccessor, cr types.ColorResolver, skip_alpha bool) ([]*NodeWithColor, error)

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL