global

package
v0.0.0-...-e2c201e Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2023 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	VPS_COLOR      = 0xff8888ff
	PHYSICAL_COLOR = 0xffff8888

	// moving rack server from inventory
	DRAG_RACK_SERVER = 1
	// moving rack server from a rack tower
	DRAG_RACK_SERVER_FROM_TOWER = 2
	// moving TOWER, AC, GENERATOR, RACK_TOWER
	DRAG_ELEMENT_PAYLOAD = 3
)

Variables

This section is empty.

Functions

func AdjustImage

func AdjustImage(image *sdl.Surface, w, h int32) (*sdl.Surface, error)

AdjustImage will resize an image to fit into w x h surface image

func AdjustMega

func AdjustMega(mega int32) string

AdjustMega get a number in megabyte, reduce it in GB, TB and return the string result

func FlashImage

func FlashImage(surface *sdl.Surface, level uint32)

FlashImage will flash/brighten a surface depending on the 'level' - level=8 -> completely white - level=0 -> the normal image

func GetSurfacePixel

func GetSurfacePixel(surface *sdl.Surface, x, y int32) (red, green, blue, alpha uint8)

helper function, to know which pixel is in (x.y)

It is mainly used to know if we are on a transparent pixel

func GlowImage

func GlowImage(spriteassetpath string, color uint32) *sdl.Surface

GlowImage takes a asset path, load it, and add a glow effect around it

func LoadImageAsset

func LoadImageAsset(filename string) (*sdl.Surface, error)

LoadImageAsset load an SDL (PNG) image directly from assets

func ParseMega

func ParseMega(str string) int32

ParseMega parse a string like 100M and translate it into a int32 in Megabytes

Types

This section is empty.

Jump to

Keyboard shortcuts

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