Documentation ¶
Index ¶
- func FindByte(s []byte, b byte) int
- func GetCrusadeFlagImage() [][]rune
- func GetDecisionFlagImage() [][]rune
- func GetPeopleRows() [][]rune
- type Animation
- func NewIconAnimation(mapView *MapView, icon lib.IconType, xy0, xy1 lib.MapCoords, frames int) Animation
- func NewIconsAnimation(mapView *MapView, icons []lib.IconType, xy lib.MapCoords) Animation
- func NewUnitAnimation(mapView *MapView, player *AudioPlayer, unit lib.Unit, xy0, xy1 lib.MapCoords, ...) Animation
- type AudioPlayer
- type Button
- type Command
- type CommandBuffer
- type FinalResult
- type Flashback
- type Game
- type GameLoading
- type IconAnimation
- type IconsAnimation
- type InputBox
- type Intro
- type Label
- type ListBox
- type MainScreen
- type MapDrawer
- type MapView
- func (v *MapView) AreMapCoordsVisible(mapXY lib.MapCoords) bool
- func (v *MapView) AreScreenCoordsVisible(x, y float64) bool
- func (v *MapView) Draw(screen *ebiten.Image)
- func (v *MapView) DrawSpriteBetween(sprite *ebiten.Image, mapXY0, mapXY1 lib.MapCoords, alpha float64, ...)
- func (v *MapView) GetCursorPosition() lib.MapCoords
- func (v *MapView) GetSpriteForUnit(unit lib.Unit) *ebiten.Image
- func (v *MapView) GetSpriteFromIcon(icon lib.IconType) *ebiten.Image
- func (v *MapView) HideIcon()
- func (v *MapView) MapCoordsToScreenCoords(mapXY lib.MapCoords) (x, y float64)
- func (v *MapView) ScreenCoordsToUnitCoords(screenX, screenY int) lib.UnitCoords
- func (v *MapView) SetCursorPosition(xy lib.MapCoords)
- func (v *MapView) SetIsNight(isNight bool)
- func (v *MapView) SetUnitDisplay(unitDisplay lib.UnitDisplay)
- func (v *MapView) ShowAnimatedIcon(icons []lib.IconType, xy lib.MapCoords, dx, dy float64)
- func (v *MapView) ShowIcon(icon lib.IconType, xy lib.MapCoords, dx, dy float64)
- type MessageBox
- type OptionSelection
- type OverviewMap
- type Rectangle
- type ScenarioLoading
- type ScenarioSelection
- type SubGame
- type UnitAnimation
- type VariantSelection
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetCrusadeFlagImage ¶
func GetCrusadeFlagImage() [][]rune
func GetDecisionFlagImage ¶
func GetDecisionFlagImage() [][]rune
func GetPeopleRows ¶
func GetPeopleRows() [][]rune
Types ¶
type Animation ¶
type Animation interface { Update() Done() bool Draw(screen *ebiten.Image) }
func NewIconAnimation ¶
func NewIconsAnimation ¶
func NewUnitAnimation ¶
type AudioPlayer ¶
type AudioPlayer struct {
// contains filtered or unexported fields
}
A trivial player generating strictly rectangular waves of given frequency on 4 channels.
func NewAudioPlayer ¶
func NewAudioPlayer(context *oto.Context) *AudioPlayer
func (*AudioPlayer) Close ¶
func (p *AudioPlayer) Close()
func (*AudioPlayer) SetFrequency ¶
func (p *AudioPlayer) SetFrequency(channel int, freq byte)
type Command ¶
type Command int
const ( Freeze Command = iota StatusReport UnitInfo GeneralInfo CityInfo HideUnits ShowOverviewMap ShowFlashback Who DecreaseSpeed IncreaseSpeed SwitchUnitDisplay SwitchSides Quit ScrollDown ScrollDownFast ScrollUp ScrollUpFast ScrollLeft ScrollLeftFast ScrollRight ScrollRightFast Reserve Defend Attack Move SetObjective Save Load TurboMode )
type CommandBuffer ¶
type CommandBuffer struct {
Commands chan Command
}
func NewCommandBuffer ¶
func NewCommandBuffer(size uint) *CommandBuffer
func (*CommandBuffer) Update ¶
func (b *CommandBuffer) Update()
type FinalResult ¶
type FinalResult struct {
// contains filtered or unexported fields
}
func NewFinalResult ¶
func NewFinalResult(result, difficulty, rank int, font *lib.Font, onRestartGame func()) *FinalResult
func (*FinalResult) Draw ¶
func (s *FinalResult) Draw(screen *ebiten.Image)
func (*FinalResult) Update ¶
func (s *FinalResult) Update() error
type Flashback ¶
type Flashback struct {
// contains filtered or unexported fields
}
func NewFlashback ¶
func NewFlashback(mapView *MapView, messageBox *MessageBox, flashback lib.FlashbackHistory, terrainTypeMap *lib.TerrainTypeMap) *Flashback
type GameLoading ¶
type GameLoading struct {
// contains filtered or unexported fields
}
func NewGameLoading ¶
func NewGameLoading(fsys fs.FS, onGameLoaded func(*lib.GameData)) *GameLoading
func (*GameLoading) Draw ¶
func (l *GameLoading) Draw(screen *ebiten.Image)
func (*GameLoading) Update ¶
func (l *GameLoading) Update() error
type IconAnimation ¶
type IconAnimation struct {
// contains filtered or unexported fields
}
func (*IconAnimation) Done ¶
func (a *IconAnimation) Done() bool
func (*IconAnimation) Draw ¶
func (a *IconAnimation) Draw(screen *ebiten.Image)
func (*IconAnimation) Update ¶
func (a *IconAnimation) Update()
type IconsAnimation ¶
type IconsAnimation struct {
// contains filtered or unexported fields
}
func (*IconsAnimation) Done ¶
func (a *IconsAnimation) Done() bool
func (*IconsAnimation) Draw ¶
func (a *IconsAnimation) Draw(screen *ebiten.Image)
func (*IconsAnimation) Update ¶
func (a *IconsAnimation) Update()
type InputBox ¶
type InputBox struct {
// contains filtered or unexported fields
}
func NewInputBox ¶
func (*InputBox) SetBackgroundColor ¶
func (*InputBox) SetTextColor ¶
func (i *InputBox) SetText(text string) { i.text = text i.cursorPosition = len(i.text) }
type Label ¶
type Label struct {
// contains filtered or unexported fields
}
func (*Label) ContainsPoint ¶
func (*Label) SetBackgroundColor ¶
func (*Label) SetCharInverted ¶
func (*Label) SetTextColor ¶
type ListBox ¶
type ListBox struct {
// contains filtered or unexported fields
}
func NewListBox ¶
func (*ListBox) SetBackgroundColor ¶
func (*ListBox) SetTextColor ¶
type MainScreen ¶
type MainScreen struct {
// contains filtered or unexported fields
}
func NewMainScreen ¶
func NewMainScreen(g *Game, options *lib.Options, audioPlayer *AudioPlayer, rand *rand.Rand, onGameOver func(int, int, int)) *MainScreen
func (*MainScreen) Draw ¶
func (s *MainScreen) Draw(screen *ebiten.Image)
func (*MainScreen) Update ¶
func (s *MainScreen) Update() error
type MapDrawer ¶
type MapDrawer struct {
// contains filtered or unexported fields
}
func NewMapDrawer ¶
func (*MapDrawer) GetMapImage ¶
func (*MapDrawer) GetSpriteFromTileNum ¶
type MapView ¶
type MapView struct {
// contains filtered or unexported fields
}
func NewMapView ¶
func NewMapView( x, y float64, width, height int, terrainMap *lib.Map, terrainTypeMap *lib.TerrainTypeMap, units *lib.Units, minMapX, minMapY, maxMapX, maxMapY int, tiles *[48]*image.Paletted, unitSymbols *[16]*image.Paletted, unitIcons *[16]*image.Paletted, icons *[24]*image.Paletted, daytimePalette *[8]byte, nightPalette *[8]byte) *MapView
func (*MapView) AreMapCoordsVisible ¶
func (*MapView) AreScreenCoordsVisible ¶
func (*MapView) DrawSpriteBetween ¶
func (*MapView) GetCursorPosition ¶
func (*MapView) GetSpriteForUnit ¶
func (*MapView) GetSpriteFromIcon ¶
func (*MapView) MapCoordsToScreenCoords ¶
func (*MapView) ScreenCoordsToUnitCoords ¶
func (v *MapView) ScreenCoordsToUnitCoords(screenX, screenY int) lib.UnitCoords
func (*MapView) SetCursorPosition ¶
func (*MapView) SetIsNight ¶
func (*MapView) SetUnitDisplay ¶
func (v *MapView) SetUnitDisplay(unitDisplay lib.UnitDisplay)
func (*MapView) ShowAnimatedIcon ¶
type MessageBox ¶
type MessageBox struct {
// contains filtered or unexported fields
}
func NewMessageBox ¶
func NewMessageBox(x, y float64, width, height int, font *lib.Font) *MessageBox
func (*MessageBox) Clear ¶
func (b *MessageBox) Clear()
func (*MessageBox) ClearRow ¶
func (b *MessageBox) ClearRow(y int)
func (*MessageBox) Draw ¶
func (b *MessageBox) Draw(screen *ebiten.Image)
func (*MessageBox) Print ¶
func (b *MessageBox) Print(str string, x, y int)
func (*MessageBox) SetRowBackground ¶
func (b *MessageBox) SetRowBackground(y, color int)
func (*MessageBox) SetTextColor ¶
func (b *MessageBox) SetTextColor(color int)
type OptionSelection ¶
type OptionSelection struct {
// contains filtered or unexported fields
}
func NewOptionSelection ¶
func (*OptionSelection) Draw ¶
func (s *OptionSelection) Draw(screen *ebiten.Image)
func (*OptionSelection) Update ¶
func (s *OptionSelection) Update() error
type OverviewMap ¶
type OverviewMap struct {
// contains filtered or unexported fields
}
func NewOverviewMap ¶
func (*OverviewMap) Draw ¶
func (m *OverviewMap) Draw(screen *ebiten.Image, opts *ebiten.DrawImageOptions)
func (*OverviewMap) Update ¶
func (m *OverviewMap) Update()
type Rectangle ¶
type Rectangle struct {
// contains filtered or unexported fields
}
func NewRectangle ¶
type ScenarioLoading ¶
type ScenarioLoading struct {
// contains filtered or unexported fields
}
func NewScenarioLoading ¶
func NewScenarioLoading(fsys fs.FS, scenario lib.Scenario, font *lib.Font, onScenarioLoaded func(*lib.ScenarioData)) *ScenarioLoading
func (*ScenarioLoading) Draw ¶
func (l *ScenarioLoading) Draw(screen *ebiten.Image)
func (*ScenarioLoading) Update ¶
func (l *ScenarioLoading) Update() error
type ScenarioSelection ¶
type ScenarioSelection struct {
// contains filtered or unexported fields
}
func NewScenarioSelection ¶
func (*ScenarioSelection) Draw ¶
func (s *ScenarioSelection) Draw(screen *ebiten.Image)
func (*ScenarioSelection) Update ¶
func (s *ScenarioSelection) Update() error
type UnitAnimation ¶
type UnitAnimation struct {
// contains filtered or unexported fields
}
func (*UnitAnimation) Done ¶
func (a *UnitAnimation) Done() bool
func (*UnitAnimation) Draw ¶
func (a *UnitAnimation) Draw(screen *ebiten.Image)
func (*UnitAnimation) Update ¶
func (a *UnitAnimation) Update()
type VariantSelection ¶
type VariantSelection struct {
// contains filtered or unexported fields
}
func NewVariantSelection ¶
func (*VariantSelection) Draw ¶
func (s *VariantSelection) Draw(screen *ebiten.Image)
func (*VariantSelection) Update ¶
func (s *VariantSelection) Update() error
Source Files ¶
Click to show internal directories.
Click to hide internal directories.