Documentation ¶
Index ¶
- func GenerateNavImage(navPoint *model.NavPoint, imageSize int, font *Font, clr *color.NRGBA) *ebiten.Image
- func GetSpriteSheetSlices(img *ebiten.Image, columns, rows int) ([]*ebiten.Image, []image.Rectangle)
- type Altimeter
- type Armament
- type BasicHUD
- type Compass
- func (c *Compass) Draw(bounds image.Rectangle, hudOpts *DrawHudOptions)
- func (c *Compass) SetNavEnabled(b bool)
- func (c *Compass) SetNavHeading(heading float64)
- func (c *Compass) SetTargetEnabled(b bool)
- func (c *Compass) SetTargetHeading(heading float64)
- func (c *Compass) SetValues(heading, turretAngle float64)
- type Crosshairs
- type DrawHudOptions
- type EffectSprite
- type EmplacementSprite
- type FPSIndicator
- type Font
- type FontHandler
- type HUDSprite
- type HeatIndicator
- type InfantrySprite
- type JumpJetIndicator
- type MechAnimationIndex
- type MechPart
- type MechSprite
- func (m *MechSprite) Clone(asUnit model.Unit) *MechSprite
- func (m *MechSprite) Mech() *model.Mech
- func (s *MechSprite) MechAnimation() MechAnimationIndex
- func (s *MechSprite) ResetAnimation()
- func (s *MechSprite) ResetStrideStomp()
- func (s *MechSprite) SetMechAnimation(animateIndex MechAnimationIndex, reversed bool)
- func (s *MechSprite) StrideStomp() bool
- func (s *MechSprite) Update(camPos *geom.Vector2)
- type MechSpriteAnimate
- type NavReticle
- type NavSprite
- type NavStatus
- type ProjectileSprite
- func (p *ProjectileSprite) Clone() *ProjectileSprite
- func (p *ProjectileSprite) Damage() float64
- func (p *ProjectileSprite) DecreaseLifespan(decreaseBy float64) float64
- func (p *ProjectileSprite) Destroy()
- func (p *ProjectileSprite) ImpactAudio() string
- func (p *ProjectileSprite) Lifespan() float64
- func (p *ProjectileSprite) SpawnEffect(x, y, z, angle, pitch float64) *EffectSprite
- func (s *ProjectileSprite) Update(camPos *geom.Vector2)
- type Radar
- func (r *Radar) Draw(bounds image.Rectangle, hudOpts *DrawHudOptions)
- func (r *Radar) SetMapLines(lines []*geom.Line)
- func (r *Radar) SetNavPoints(radarNavPoints []*RadarNavPoint)
- func (r *Radar) SetRadarBlips(blips []*RadarBlip)
- func (r *Radar) SetValues(position *geom.Vector2, heading, turretAngle, fovDegrees float64)
- type RadarBlip
- type RadarNavPoint
- type Sprite
- func (s *Sprite) AnimationFrameCounter() int
- func (s *Sprite) AnimationReversed() bool
- func (s *Sprite) Clone() *Sprite
- func (s *Sprite) DestroyCounter() int
- func (s *Sprite) Illumination() float64
- func (s *Sprite) IsFocusable() bool
- func (s *Sprite) LoopCounter() int
- func (s *Sprite) NumAnimationFrames() int
- func (s *Sprite) Pos() *geom.Vector2
- func (s *Sprite) PosZ() float64
- func (s *Sprite) ResetAnimation()
- func (s *Sprite) Scale() float64
- func (s *Sprite) ScreenRect(renderScale float64) *image.Rectangle
- func (s *Sprite) SetAnimationReversed(isReverse bool)
- func (s *Sprite) SetDestroyCounter(counter int) int
- func (s *Sprite) SetIlluminationPeriod(illumination float64, periodSeconds float64)
- func (s *Sprite) SetScale(scale float64)
- func (s *Sprite) SetScreenRect(rect *image.Rectangle)
- func (s *Sprite) SetTextureFacingMap(texFacingMap map[float64]int)
- func (s *Sprite) SetTextureFrame(texNum int)
- func (s *Sprite) StaticTexture() *ebiten.Image
- func (s *Sprite) Texture() *ebiten.Image
- func (s *Sprite) TextureRect() image.Rectangle
- func (s *Sprite) Update(camPos *geom.Vector2)
- func (s *Sprite) VerticalAnchor() raycaster.SpriteAnchor
- type TargetReticle
- type Throttle
- type UnitStatus
- func (u *UnitStatus) Draw(bounds image.Rectangle, hudOpts *DrawHudOptions)
- func (u *UnitStatus) SetTargetLock(lockPercent float64)
- func (u *UnitStatus) SetTargetReticle(reticle *TargetReticle)
- func (u *UnitStatus) SetUnit(unit *Sprite)
- func (u *UnitStatus) SetUnitDistance(distance float64)
- func (u *UnitStatus) ShowTargetLock(show bool)
- func (u *UnitStatus) Unit() *Sprite
- type VTOLSprite
- type VehicleSprite
- type Weapon
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateNavImage ¶
func GetSpriteSheetSlices ¶
Types ¶
type Altimeter ¶
type Altimeter struct { HUDSprite // contains filtered or unexported fields }
func NewAltimeter ¶
NewAltimeter creates a compass image to be rendered on demand
type Armament ¶
type Armament struct { HUDSprite // contains filtered or unexported fields }
func NewArmament ¶
NewArmament creates a weapon list image to be rendered on demand
func (*Armament) SetSelectedWeapon ¶
func (a *Armament) SetSelectedWeapon(weaponOrGroupIndex uint, weaponFireMode model.WeaponFireMode)
func (*Armament) SetWeaponGroups ¶
func (*Armament) SetWeapons ¶
type BasicHUD ¶
type BasicHUD struct {
// contains filtered or unexported fields
}
func NewHUDSprite ¶
func NewHUDSpriteFromSheet ¶
func (*BasicHUD) NumTextureFrames ¶
func (*BasicHUD) SetTextureFrame ¶
type Compass ¶
type Compass struct { HUDSprite // contains filtered or unexported fields }
func NewCompass ¶
NewCompass creates a compass image to be rendered on demand
func (*Compass) SetNavEnabled ¶
func (*Compass) SetNavHeading ¶
func (*Compass) SetTargetEnabled ¶
func (*Compass) SetTargetHeading ¶
type Crosshairs ¶
type Crosshairs struct {
HUDSprite
}
func NewCrosshairs ¶
func NewCrosshairs( img *ebiten.Image, scale float64, columns, rows, crosshairIndex int, ) *Crosshairs
func (*Crosshairs) Draw ¶
func (c *Crosshairs) Draw(bounds image.Rectangle, hudOpts *DrawHudOptions)
type DrawHudOptions ¶
type EffectSprite ¶
type EffectSprite struct { *Sprite LoopCount int AudioFile string AttachedTo *Sprite AttachedDepth float64 }
func NewAnimatedEffect ¶
func NewAnimatedEffect( r *model.ModelEffectResource, img *ebiten.Image, loopCount int, ) *EffectSprite
func (*EffectSprite) AnimationDuration ¶
func (e *EffectSprite) AnimationDuration() int
func (*EffectSprite) Clone ¶
func (e *EffectSprite) Clone() *EffectSprite
func (*EffectSprite) Update ¶
func (e *EffectSprite) Update(camPos *geom.Vector2)
type EmplacementSprite ¶
type EmplacementSprite struct {
*Sprite
}
func NewEmplacementSprite ¶
func NewEmplacementSprite( emplacement *model.Emplacement, scale float64, img *ebiten.Image, ) *EmplacementSprite
func (*EmplacementSprite) Clone ¶
func (t *EmplacementSprite) Clone(asUnit model.Unit) *EmplacementSprite
type FPSIndicator ¶
type FPSIndicator struct { HUDSprite // contains filtered or unexported fields }
func NewFPSIndicator ¶
func NewFPSIndicator(font *Font) *FPSIndicator
NewFPSIndicator creates an FPS indicator to be rendered on demand
func (*FPSIndicator) Draw ¶
func (f *FPSIndicator) Draw(bounds image.Rectangle, hudOpts *DrawHudOptions)
func (*FPSIndicator) SetFPSText ¶
func (f *FPSIndicator) SetFPSText(fpsText string)
type FontHandler ¶
type FontHandler struct {
HUDFont *Font
}
func NewFontHandler ¶
func NewFontHandler(hudFont string) (*FontHandler, error)
type HeatIndicator ¶
type HeatIndicator struct { HUDSprite // contains filtered or unexported fields }
func NewHeatIndicator ¶
func NewHeatIndicator(font *Font) *HeatIndicator
NewHeatIndicator creates a heat indicator image to be rendered on demand
func (*HeatIndicator) Draw ¶
func (h *HeatIndicator) Draw(bounds image.Rectangle, hudOpts *DrawHudOptions)
func (*HeatIndicator) SetValues ¶
func (h *HeatIndicator) SetValues(heat, maxHeat, dissipation float64)
type InfantrySprite ¶
type InfantrySprite struct { *Sprite // TODO: move to separate AI handler PatrolPathIndex int PatrolPath [][2]float64 }
func NewInfantrySprite ¶
func NewInfantrySprite( infantry *model.Infantry, scale float64, img *ebiten.Image, ) *InfantrySprite
func (*InfantrySprite) Clone ¶
func (t *InfantrySprite) Clone(asUnit model.Unit) *InfantrySprite
type JumpJetIndicator ¶
type JumpJetIndicator struct { HUDSprite // contains filtered or unexported fields }
func NewJumpJetIndicator ¶
func NewJumpJetIndicator(font *Font) *JumpJetIndicator
NewJumpJetIndicator creates a jump jet indicator image to be rendered on demand
func (*JumpJetIndicator) Draw ¶
func (j *JumpJetIndicator) Draw(bounds image.Rectangle, hudOpts *DrawHudOptions)
func (*JumpJetIndicator) SetValues ¶
func (j *JumpJetIndicator) SetValues(jumpJetDuration, maxJumpJetDuration float64)
type MechAnimationIndex ¶
type MechAnimationIndex int
const ( MECH_ANIMATE_IDLE MechAnimationIndex = iota MECH_ANIMATE_STRUT MECH_ANIMATE_JUMP_JET MECH_ANIMATE_SHUTDOWN MECH_ANIMATE_DESTRUCT NUM_MECH_ANIMATIONS MECH_ANIMATE_STATIC MechAnimationIndex = -1 )
type MechSprite ¶
type MechSprite struct { *Sprite // TODO: move to separate AI handler PatrolPathIndex int PatrolPath [][2]float64 // TODO: general purpose method to track state of similar things JetsPlaying bool // contains filtered or unexported fields }
func NewMechSprite ¶
func NewMechSprite( mech *model.Mech, scale float64, img *ebiten.Image, ) *MechSprite
func (*MechSprite) Clone ¶
func (m *MechSprite) Clone(asUnit model.Unit) *MechSprite
func (*MechSprite) Mech ¶
func (m *MechSprite) Mech() *model.Mech
func (*MechSprite) MechAnimation ¶
func (s *MechSprite) MechAnimation() MechAnimationIndex
func (*MechSprite) ResetAnimation ¶
func (s *MechSprite) ResetAnimation()
func (*MechSprite) ResetStrideStomp ¶
func (s *MechSprite) ResetStrideStomp()
func (*MechSprite) SetMechAnimation ¶
func (s *MechSprite) SetMechAnimation(animateIndex MechAnimationIndex, reversed bool)
func (*MechSprite) StrideStomp ¶
func (s *MechSprite) StrideStomp() bool
func (*MechSprite) Update ¶
func (s *MechSprite) Update(camPos *geom.Vector2)
type MechSpriteAnimate ¶
type MechSpriteAnimate struct {
// contains filtered or unexported fields
}
func NewMechAnimationSheetFromImage ¶
func NewMechAnimationSheetFromImage(srcImage *ebiten.Image) *MechSpriteAnimate
NewMechAnimationSheetFromImage creates a new image sheet with generated image frames for mech sprite animation
type NavReticle ¶
type NavReticle struct {
}func NewNavReticle ¶
func NewNavReticle(scale float64, img *ebiten.Image) *NavReticle
NewNavReticle creates a nav reticle from an image
func (*NavReticle) Draw ¶
func (t *NavReticle) Draw(bounds image.Rectangle, hudOpts *DrawHudOptions)
type NavStatus ¶
type NavStatus struct { // contains filtered or unexported fields }
func NewNavStatus ¶
NewNavStatus creates a nav status element image to be rendered on demand
func (*NavStatus) SetNavDistance ¶
func (*NavStatus) SetNavPoint ¶
type ProjectileSprite ¶
type ProjectileSprite struct { *Sprite ImpactAudioFiles []string ImpactEffect EffectSprite Projectile *model.Projectile }
func NewAnimatedProjectile ¶
func NewAnimatedProjectile( projectile *model.Projectile, scale float64, img *ebiten.Image, impactEffect EffectSprite, impactAudioFiles []string, ) *ProjectileSprite
func (*ProjectileSprite) Clone ¶
func (p *ProjectileSprite) Clone() *ProjectileSprite
func (*ProjectileSprite) Damage ¶
func (p *ProjectileSprite) Damage() float64
func (*ProjectileSprite) DecreaseLifespan ¶
func (p *ProjectileSprite) DecreaseLifespan(decreaseBy float64) float64
func (*ProjectileSprite) Destroy ¶
func (p *ProjectileSprite) Destroy()
func (*ProjectileSprite) ImpactAudio ¶
func (p *ProjectileSprite) ImpactAudio() string
func (*ProjectileSprite) Lifespan ¶
func (p *ProjectileSprite) Lifespan() float64
func (*ProjectileSprite) SpawnEffect ¶
func (p *ProjectileSprite) SpawnEffect(x, y, z, angle, pitch float64) *EffectSprite
func (*ProjectileSprite) Update ¶
func (s *ProjectileSprite) Update(camPos *geom.Vector2)
type Radar ¶
type Radar struct { HUDSprite // contains filtered or unexported fields }
func (*Radar) SetMapLines ¶
func (*Radar) SetNavPoints ¶
func (r *Radar) SetNavPoints(radarNavPoints []*RadarNavPoint)
func (*Radar) SetRadarBlips ¶
type RadarNavPoint ¶
type RadarNavPoint struct {}
type Sprite ¶
func NewAnimatedSprite ¶
func NewSpriteFromSheet ¶
func (*Sprite) AnimationFrameCounter ¶
func (*Sprite) AnimationReversed ¶
func (*Sprite) DestroyCounter ¶
DestroyCounter used only when destroyed to remain visible until ready to be removed
func (*Sprite) Illumination ¶
func (*Sprite) IsFocusable ¶
func (*Sprite) LoopCounter ¶
func (*Sprite) NumAnimationFrames ¶
func (*Sprite) ResetAnimation ¶
func (s *Sprite) ResetAnimation()
func (*Sprite) SetAnimationReversed ¶
func (*Sprite) SetDestroyCounter ¶
SetDestroyCounter to set how many ticks to remain visible after destroyed before removal
func (*Sprite) SetIlluminationPeriod ¶
func (*Sprite) SetScreenRect ¶
func (*Sprite) SetTextureFacingMap ¶
func (*Sprite) SetTextureFrame ¶
func (*Sprite) StaticTexture ¶
func (s *Sprite) StaticTexture() *ebiten.Image
func (*Sprite) TextureRect ¶
func (*Sprite) VerticalAnchor ¶
func (s *Sprite) VerticalAnchor() raycaster.SpriteAnchor
type TargetReticle ¶
type TargetReticle struct {
HUDSprite
}
func NewTargetReticle ¶
func NewTargetReticle(scale float64, img *ebiten.Image) *TargetReticle
NewTargetReticle creates a target reticle from an image with 2 rows and 2 columns, representing the four corners of it
func (*TargetReticle) Draw ¶
func (t *TargetReticle) Draw(bounds image.Rectangle, hudOpts *DrawHudOptions)
type Throttle ¶
type Throttle struct { HUDSprite // contains filtered or unexported fields }
func NewThrottle ¶
NewThrottle creates a speed indicator image to be rendered on demand
type UnitStatus ¶
type UnitStatus struct { HUDSprite // contains filtered or unexported fields }
func NewUnitStatus ¶
func NewUnitStatus(isPlayer bool, font *Font) *UnitStatus
NewUnitStatus creates a unit status element image to be rendered on demand
func (*UnitStatus) Draw ¶
func (u *UnitStatus) Draw(bounds image.Rectangle, hudOpts *DrawHudOptions)
func (*UnitStatus) SetTargetLock ¶
func (u *UnitStatus) SetTargetLock(lockPercent float64)
func (*UnitStatus) SetTargetReticle ¶
func (u *UnitStatus) SetTargetReticle(reticle *TargetReticle)
func (*UnitStatus) SetUnit ¶
func (u *UnitStatus) SetUnit(unit *Sprite)
func (*UnitStatus) SetUnitDistance ¶
func (u *UnitStatus) SetUnitDistance(distance float64)
func (*UnitStatus) ShowTargetLock ¶
func (u *UnitStatus) ShowTargetLock(show bool)
func (*UnitStatus) Unit ¶
func (u *UnitStatus) Unit() *Sprite
type VTOLSprite ¶
type VTOLSprite struct { *Sprite // TODO: move to separate AI handler PatrolPathIndex int PatrolPath [][2]float64 }
func NewVTOLSprite ¶
func NewVTOLSprite( vtol *model.VTOL, scale float64, img *ebiten.Image, ) *VTOLSprite
func (*VTOLSprite) Clone ¶
func (v *VTOLSprite) Clone(asUnit model.Unit) *VTOLSprite
type VehicleSprite ¶
type VehicleSprite struct { *Sprite // TODO: move to separate AI handler PatrolPathIndex int PatrolPath [][2]float64 }
func NewVehicleSprite ¶
func NewVehicleSprite( vehicle *model.Vehicle, scale float64, img *ebiten.Image, ) *VehicleSprite
func (*VehicleSprite) Clone ¶
func (v *VehicleSprite) Clone(asUnit model.Unit) *VehicleSprite
Source Files ¶
- altimeter.go
- armament.go
- compass.go
- crosshairs.go
- effect_sprite.go
- emplacement_sprite.go
- fonts.go
- fps.go
- heat.go
- hud_sprite.go
- infantry_sprite.go
- jets.go
- mech_animate.go
- mech_sprite.go
- nav_sprite.go
- nav_status.go
- projectile_sprite.go
- radar.go
- reticle.go
- sprite.go
- throttle.go
- unit_status.go
- vehicle_sprite.go
- vtol_sprite.go