Documentation ¶
Index ¶
- Constants
- Variables
- func ChangeHSV(clr color.RGBA, hueTheta float64, saturationScale float64, valueScale float64) color.RGBA
- func ChangeImageHSV(img *ebiten.Image, hueTheta float64, saturationScale float64, ...) *ebiten.Image
- func GetFontFace(fontId int, size float64) font.Face
- func LoadImage(name string) *ebiten.Image
- func LoadMap(mapId int) *tiled.Map
- func NewBounds(x, y, w, h int) image.Rectangle
- func NewBuildingColorMatrix() colorm.ColorM
- func NewMapRenderer(m *tiled.Map) (*render.Renderer, error)
- func NewTerrainColorMatrix() colorm.ColorM
- func NewUnitColorMatrix() colorm.ColorM
- func ScaleColor(clr color.RGBA, r, g, b float64) color.RGBA
- func ScaleImage(img *ebiten.Image, x, y float64) *ebiten.Image
- func ScaleImageLightness(img *ebiten.Image, scale float64) *ebiten.Image
- func SubImage(img *ebiten.Image, rect image.Rectangle) *ebiten.Image
- type DefaultSpriteGetter
- func (d *DefaultSpriteGetter) GetBuildingSprite(playerId uint8, spriteId uint8, buildingState rts.BuildingState) *ebiten.Image
- func (d *DefaultSpriteGetter) GetBuildingSpriteOrigin(spriteId uint8) image.Point
- func (d *DefaultSpriteGetter) GetSpawnPointSprite(playerId uint8) *ebiten.Image
- func (d *DefaultSpriteGetter) GetUnitFireFrame(playerId uint8, spriteId uint8, direction Direction, frame uint) *ebiten.Image
- func (d *DefaultSpriteGetter) GetUnitSprite(playerId uint8, spriteId uint8, direction Direction) *ebiten.Image
- type Direction
- type SpriteGetter
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 ChangeImageHSV ¶
func NewBuildingColorMatrix ¶
func NewMapRenderer ¶
func NewTerrainColorMatrix ¶
func NewUnitColorMatrix ¶
func ScaleImage ¶
func ScaleImage(img *ebiten.Image, x, y float64) *ebiten.Image
func ScaleImageLightness ¶
func ScaleImageLightness(img *ebiten.Image, scale float64) *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
func DirectionFromDelta ¶
func StepToDirection ¶
func (Direction) IsDiagonal ¶
func (Direction) IsHorizontal ¶
func (Direction) IsStraight ¶
func (Direction) IsVertical ¶
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 }
Click to show internal directories.
Click to hide internal directories.