load

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const Fill float64 = 100000.767898765556788777667787666

Fill is constant important to ui, it is also redeclare here so check it out

Variables

This section is empty.

Functions

func CollectFloats

func CollectFloats(values []interface{}, buff []float64) int

CollectFloats collects consecutive floating point numbers and returns how match was collected

func ParseRGBA

func ParseRGBA(values []interface{}) (c mat.RGBA, ln int)

ParseRGBA parses slice if interfaces into color and returns how big the color was

syntax:

	name - simple name of color can be enough if its contained in map in mlok/mat/rgba package
 a - specify only one float/int channel and mat.Alpha(alpha) will be returned
 r, g, b - specify threes floats/ints and mat.RGB(r, g, b) will be returned
 r, g, b, a - specify four floats/ints and mat.RGBA{r, g, b, a} will be returned
 hex - hex color notation

Types

type RawStyle

type RawStyle struct {
	goss.Style
}

RawStyle is wrapper of goss.RawStyle and adds extra functionality

func (RawStyle) AABB

func (r RawStyle) AABB(key string, def mat.AABB) (m mat.AABB)

AABB parser margin under the key, if parsing fails or margin is not present, default is returned

func (RawStyle) Bool

func (r RawStyle) Bool(key string, def bool) (v bool)

Bool returns boolean value under the key, or def if retrieval fails

func (RawStyle) Float

func (r RawStyle) Float(key string, def float64) (v float64)

Float returns float under the key of default value if obtaining failed

func (RawStyle) Ident

func (r RawStyle) Ident(key, def string) string

Ident returns string from RawStyle or def if not present

func (RawStyle) Int

func (r RawStyle) Int(key string, def int) (v int)

func (RawStyle) RGBA

func (r RawStyle) RGBA(key string, def mat.RGBA) (c mat.RGBA)

RGBA returns a color under the key, if color parsing fails or color is not present, def is returned this also accepts names mapped in mlok/mat/rgba.Colors

func (RawStyle) Region

func (r RawStyle) Region(key string, regions map[string]mat.AABB, def mat.AABB) mat.AABB

Region returns a texture region, it can be hardcoded aabb or region name.

func (RawStyle) Sub

func (r RawStyle) Sub(key string, def RawStyle) (v RawStyle)

Sub retrieves Substyle under the key, or returns def

func (RawStyle) Vec

func (r RawStyle) Vec(key string, def mat.Vec) (u mat.Vec)

Vec returns vector under tha key, if parsing fails or vec is not present def is returned

Jump to

Keyboard shortcuts

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