assets

package
v0.0.0-...-6b508d1 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2024 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Font_GoRegular = iota
	Font_PressStart
)
View Source
const (
	TileSize     = 16
	BuildingSize = 32
	UnitSize     = 24
)
View Source
const (
	BuildingSpriteId_Main = iota
	BuildingSpriteId_Storage
	BuildingSpriteId_Lab
	BuildingSpriteId_Armory
	BuildingSpriteId_Mine
	BuildingSpriteId_SmallMine
	BuildingSpriteId_Count
)
View Source
const (
	UnitSpriteId_AntiAir = iota
	UnitSpriteId_Air
	UnitSpriteId_Tank
	UnitSpriteId_Turret
	UnitSpriteId_Worker
	UnitSpriteId_Count
)
View Source
const (
	MapTilesetId_Royale = iota
)

Variables

View Source
var (
	BitmapFont1 = bitmapfont.Face
	BitmapFont2 = scaleFont(BitmapFont1, 2)
	BitmapFont3 = scaleFont(BitmapFont1, 3)
)
View Source
var (
	LightGray = color.Gray{0xe0}

	TerrainBackgroundColor = color.RGBA{0x26, 0x1b, 0x23, 0xff}
	GroundColor            = color.RGBA{0xfa, 0xde, 0xb1, 0xff}
	ResourceColor          = color.RGBA{0xf9, 0xab, 0x8a, 0xff}
	ComputeColor           = color.RGBA{0x1d, 0xb5, 0x76, 0xff}

	LightBlueShadowColor = color.RGBA{0x9b, 0xab, 0xb2, 96}
	DarkShadowColor      = color.RGBA{0x00, 0x00, 0x00, 32}

	UIFogColor     = color.RGBA{0x3b, 0x33, 0x42, 96}
	TextLightColor = color.RGBA{0xb6, 0xa8, 0xbf, 0xff}
	TextDarkColor  = color.RGBA{0x8e, 0x7b, 0x9e, 0xff}
)
View Source
var (
	AnticipatedColorMatrix  = colorm.ColorM{}
	UnpaidColorMatrix       = colorm.ColorM{}
	SpawningColorMatrix     = colorm.ColorM{}
	GhostColorMatrix        = colorm.ColorM{}
	NonBuildableColorMatrix = colorm.ColorM{}
)
View Source
var (
	MineSprite       = SubImage(spriteSheet, NewBounds(0, 0, 18, 16))
	SmallMinesSprite = SubImage(spriteSheet, NewBounds(0, 16, 16, 16))

	UnitSpriteOrigin = image.Point{4, 4}

	SelectionSprite = SubImage(spriteSheet, NewBounds(16, 16, 16, 16))
)
View Source
var (
	UICornerSize_Small = 2
	UICornerSize_Big   = 5

	UIBox_Small           = SubImage(uiSpriteSheet, NewBounds(0, 0, 6, 6))
	UIBox_Big             = SubImage(uiSpriteSheet, NewBounds(0, 6, 12, 12))
	UIPanel_Convex        = SubImage(uiSpriteSheet, NewBounds(6, 0, 6, 6))
	UIProgressBar_Track   = SubImage(uiSpriteSheet, NewBounds(0, 18, 6, 6))
	UIProgressBar_Mineral = SubImage(uiSpriteSheet, NewBounds(0, 24, 6, 6))
	UIProgressBar_Compute = SubImage(uiSpriteSheet, NewBounds(6, 24, 6, 6))
)

Functions

func ChangeHSV

func ChangeHSV(clr color.RGBA, hueTheta float64, saturationScale float64, valueScale float64) color.RGBA

func ChangeImageHSV

func ChangeImageHSV(img *ebiten.Image, hueTheta float64, saturationScale float64, valueScale float64) *ebiten.Image

func GetFontFace

func GetFontFace(fontId int, size float64) font.Face

func LoadImage

func LoadImage(name string) *ebiten.Image

func LoadMap

func LoadMap(mapId int) *tiled.Map

func NewBounds

func NewBounds(x, y, w, h int) image.Rectangle

func NewBuildingColorMatrix

func NewBuildingColorMatrix() colorm.ColorM

func NewMapRenderer

func NewMapRenderer(m *tiled.Map) (*render.Renderer, error)

func NewTerrainColorMatrix

func NewTerrainColorMatrix() colorm.ColorM

func NewUnitColorMatrix

func NewUnitColorMatrix() colorm.ColorM

func ScaleColor

func ScaleColor(clr color.RGBA, r, g, b float64) color.RGBA

func ScaleImage

func ScaleImage(img *ebiten.Image, x, y float64) *ebiten.Image

func ScaleImageLightness

func ScaleImageLightness(img *ebiten.Image, scale float64) *ebiten.Image

func SubImage

func SubImage(img *ebiten.Image, rect image.Rectangle) *ebiten.Image

Types

type DefaultSpriteGetter

type DefaultSpriteGetter struct{}

func (*DefaultSpriteGetter) GetBuildingSprite

func (d *DefaultSpriteGetter) GetBuildingSprite(playerId uint8, spriteId uint8, buildingState rts.BuildingState) *ebiten.Image

func (*DefaultSpriteGetter) GetBuildingSpriteOrigin

func (d *DefaultSpriteGetter) GetBuildingSpriteOrigin(spriteId uint8) image.Point

func (*DefaultSpriteGetter) GetSpawnPointSprite

func (d *DefaultSpriteGetter) GetSpawnPointSprite(playerId uint8) *ebiten.Image

func (*DefaultSpriteGetter) GetUnitFireFrame

func (d *DefaultSpriteGetter) GetUnitFireFrame(playerId uint8, spriteId uint8, direction Direction, frame uint) *ebiten.Image

func (*DefaultSpriteGetter) GetUnitSprite

func (d *DefaultSpriteGetter) GetUnitSprite(playerId uint8, spriteId uint8, direction Direction) *ebiten.Image

type Direction

type Direction int
const (
	Direction_Up Direction = iota
	Direction_UpRight
	Direction_Right
	Direction_DownRight
	Direction_Down
	Direction_DownLeft
	Direction_Left
	Direction_UpLeft
)

func DirectionFromDelta

func DirectionFromDelta(delta image.Point) Direction

func StepToDirection

func StepToDirection(step image.Point) Direction

func (Direction) IsDiagonal

func (d Direction) IsDiagonal() bool

func (Direction) IsHorizontal

func (d Direction) IsHorizontal() bool

func (Direction) IsStraight

func (d Direction) IsStraight() bool

func (Direction) IsValid

func (d Direction) IsValid() bool

func (Direction) IsVertical

func (d Direction) IsVertical() bool

type SpriteGetter

type SpriteGetter interface {
	GetSpawnPointSprite(playerId uint8) *ebiten.Image
	GetBuildingSprite(playerId uint8, spriteId uint8, buildingState rts.BuildingState) *ebiten.Image
	GetBuildingSpriteOrigin(spriteId uint8) image.Point
	GetUnitSprite(playerId uint8, spriteId uint8, direction Direction) *ebiten.Image
	GetUnitFireFrame(playerId uint8, spriteId uint8, direction Direction, frame uint) *ebiten.Image
}

Jump to

Keyboard shortcuts

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