util

package
v0.0.0-...-8d0a290 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadEbitenImageFromFile

func LoadEbitenImageFromFile(path string) (*ebiten.Image, error)

func ScaleEbitenImage

func ScaleEbitenImage(image *ebiten.Image, dims Dims) *ebiten.Image

Types

type Dims

type Dims Pos[int]

type Number

type Number interface {
	int | int8 | int16 | int32 | int64 | uint | uint8 | uint16 | uint32 | uint64 | float32 | float64
}

type Pos

type Pos[N Number] struct {
	X N
	Y N
}

func MakePosFromTuple

func MakePosFromTuple[N Number](x, y N) Pos[N]

func (Pos[N]) AlmostEq

func (p Pos[N]) AlmostEq(other Pos[N], epsilon N) bool

func (Pos[N]) Eq

func (p Pos[N]) Eq(other Pos[N]) bool

func (Pos[N]) Sub

func (p Pos[N]) Sub(other Pos[N]) Pos[N]

func (Pos[N]) ToFloatPos

func (p Pos[N]) ToFloatPos() Pos[float64]

func (Pos[N]) ToIntPos

func (p Pos[N]) ToIntPos() Pos[int]

func (Pos[N]) ToTuple

func (p Pos[N]) ToTuple() (N, N)

func (Pos[N]) Translate

func (p Pos[N]) Translate(dx, dy N) Pos[N]

func (Pos[N]) TranslatePos

func (p Pos[N]) TranslatePos(offset Pos[N]) Pos[N]

Jump to

Keyboard shortcuts

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