d2helper

package
v0.0.0-...-c8cfab0 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2019 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AbsInt32

func AbsInt32(a int32) int32

func AlmostEqual

func AlmostEqual(a, b, threshold float64) bool

AlmostEqual returns true if two values are within threshold from each other

func AsterToEmpty

func AsterToEmpty(text string) string

AsterToEmpty converts strings beginning with "*" to "", for use when handling columns where an asterix can be used to comment out entries

func BytesToInt32

func BytesToInt32(b []byte) int32

BytesToInt32 converts 4 bytes to int32

func CombineStrings

func CombineStrings(input []string) string

func EmptyToZero

func EmptyToZero(text string) string

EmptyToZero converts empty strings to "0" and leaves non-empty strings as is, for use before converting numerical data which equates empty to zero

func GetAngleBetween

func GetAngleBetween(p1X, p1Y, p2X, p2Y float64) int

GetAngleBetween returns the angle between two points. 0deg is facing to the right.

func IsoToScreen

func IsoToScreen(isoX, isoY, modX, modY float64) (float64, float64)

IsoToScreen converts isometric coordinates to screenspace coordinates

func Max

func Max(a, b uint32) uint32

Max returns the higher of two values

func MaxInt

func MaxInt(a, b int) int

func MaxInt32

func MaxInt32(a, b int32) int32

MaxInt32 returns the higher of two values

func Min

func Min(a, b uint32) uint32

Min returns the lower of two values

func MinInt

func MinInt(a, b int) int

func MinInt32

func MinInt32(a, b int32) int32

MinInt32 returns the higher of two values

func NextPow2

func NextPow2(x int32) int32

func Now

func Now() float64

func SafeStringToInt

func SafeStringToInt(text string) int

SafeStringToInt converts a string to an integer, or returns -1 on falure

func ScreenToIso

func ScreenToIso(sx, sy float64) (float64, float64)

ScreenToIso converts screenspace coordinates to isometric coordinates

func SplitIntoLinesWithMaxWidth

func SplitIntoLinesWithMaxWidth(fullSentence string, maxChars int) []string

func StringToFloat64

func StringToFloat64(text string) float64

StringToFloat64 converts a string to a float64

func StringToInt

func StringToInt(text string) int

StringToInt converts a string to an integer

func StringToInt8

func StringToInt8(text string) int8

StringToInt8 converts a string to an int8

func StringToUint

func StringToUint(text string) uint

StringToUint converts a string to a uint32

func StringToUint8

func StringToUint8(text string) uint8

StringToUint8 converts a string to an uint8

func Utf16BytesToString

func Utf16BytesToString(b []byte) (string, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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