Documentation ¶
Overview ¶
Package with 'head-up display' elements.
Index ¶
- Constants
- Variables
- type Camera
- func (c *Camera) Area() *object.Area
- func (c *Camera) CenterAt(pos pixel.Vec)
- func (c *Camera) ConvCameraPos(pos pixel.Vec) pixel.Vec
- func (c *Camera) Draw(win *mtk.Window)
- func (c *Camera) Frame() pixel.Rect
- func (c *Camera) Lock(lock bool)
- func (c *Camera) Locked() bool
- func (c *Camera) Position() pixel.Vec
- func (c *Camera) SetArea(a *area.Area) error
- func (c *Camera) SetPosition(pos pixel.Vec)
- func (c *Camera) Size() pixel.Vec
- func (c *Camera) Update(win *mtk.Window)
- type CastBar
- type CharacterWindow
- func (cw *CharacterWindow) Draw(win *mtk.Window, matrix pixel.Matrix)
- func (cw *CharacterWindow) DrawArea() pixel.Rect
- func (cw *CharacterWindow) Hide()
- func (cw *CharacterWindow) Opened() bool
- func (cw *CharacterWindow) Show()
- func (cw *CharacterWindow) Size() pixel.Vec
- func (cw *CharacterWindow) Update(win *mtk.Window)
- type Chat
- type CombatLogger
- type CraftingMenu
- func (cm *CraftingMenu) Draw(win *mtk.Window, matrix pixel.Matrix)
- func (cm *CraftingMenu) DrawArea() pixel.Rect
- func (cm *CraftingMenu) Hide()
- func (cm *CraftingMenu) Opened() bool
- func (cm *CraftingMenu) Show()
- func (cm *CraftingMenu) Size() pixel.Vec
- func (cm *CraftingMenu) Update(win *mtk.Window)
- type DialogWindow
- func (dw *DialogWindow) Draw(win *mtk.Window, matrix pixel.Matrix)
- func (dw *DialogWindow) DrawArea() pixel.Rect
- func (dw *DialogWindow) Hide()
- func (dw *DialogWindow) Opened() bool
- func (dw *DialogWindow) SetDialog(d *dialog.Dialog)
- func (dw *DialogWindow) Show()
- func (dw *DialogWindow) Size() pixel.Vec
- func (dw *DialogWindow) Update(win *mtk.Window)
- type FrameTarget
- type HUD
- func (hud *HUD) Apply(data res.HUDData) error
- func (hud *HUD) Camera() *Camera
- func (hud *HUD) ChangeArea(area *area.Area) error
- func (hud *HUD) Chat() *Chat
- func (hud *HUD) CloseLoadingScreen()
- func (hud *HUD) Data() res.HUDData
- func (hud *HUD) Draw(win *mtk.Window)
- func (hud *HUD) Exit()
- func (hud *HUD) Exiting() bool
- func (hud *HUD) Game() *game.Game
- func (hud *HUD) Layout(id, serial string) *Layout
- func (hud *HUD) OpenLoadingScreen(info string)
- func (hud *HUD) PCAvatar() *object.Avatar
- func (hud *HUD) Reload()
- func (hud *HUD) RunScript(s *ash.Script)
- func (hud *HUD) SetActiveChar(char *game.Character)
- func (hud *HUD) SetGame(g *game.Game)
- func (hud *HUD) SetOnAreaChangedFunc(f func(a *area.Area))
- func (hud *HUD) ShowMessage(msg *mtk.MessageWindow)
- func (hud *HUD) Update(win *mtk.Window)
- func (hud *HUD) UserFocus() *mtk.Focus
- type InfoTarget
- type InventoryMenu
- func (im *InventoryMenu) Draw(win *mtk.Window, matrix pixel.Matrix)
- func (im *InventoryMenu) DrawArea() pixel.Rect
- func (im *InventoryMenu) Focus(focus bool)
- func (im *InventoryMenu) Focused() bool
- func (im *InventoryMenu) Hide()
- func (im *InventoryMenu) Opened() bool
- func (im *InventoryMenu) Show()
- func (im *InventoryMenu) Size() pixel.Vec
- func (im *InventoryMenu) Update(win *mtk.Window)
- type JournalWindow
- func (jw *JournalWindow) Draw(win *mtk.Window, matrix pixel.Matrix)
- func (jw *JournalWindow) DrawArea() pixel.Rect
- func (jw *JournalWindow) Hide()
- func (jw *JournalWindow) Opened() bool
- func (jw *JournalWindow) Show()
- func (jw *JournalWindow) Size() pixel.Vec
- func (jw *JournalWindow) Update(win *mtk.Window)
- type Layout
- func (l *Layout) BarSlotID(ob interface{}) int
- func (l *Layout) BarSlots() map[string]int
- func (l *Layout) InvSlotID(ob serial.Serialer) int
- func (l *Layout) InvSlots() map[string]int
- func (l *Layout) SaveBarSlot(ob interface{}, id int)
- func (l *Layout) SaveInvSlot(ob *object.ItemGraphic, slotID int)
- func (l *Layout) SetBarSlots(m map[string]int)
- func (l *Layout) SetInvSlots(m map[string]int)
- type LoadingScreen
- type LootTarget
- type LootWindow
- func (lw *LootWindow) Draw(win *mtk.Window, matrix pixel.Matrix)
- func (lw *LootWindow) DrawArea() pixel.Rect
- func (lw *LootWindow) Focus(f bool)
- func (lw *LootWindow) Focused() bool
- func (lw *LootWindow) Hide()
- func (lw *LootWindow) Opened() bool
- func (lw *LootWindow) SetTarget(t LootTarget)
- func (lw *LootWindow) Show()
- func (lw *LootWindow) Size() pixel.Vec
- func (lw *LootWindow) Update(win *mtk.Window)
- type Menu
- func (m *Menu) Draw(win *mtk.Window, matrix pixel.Matrix)
- func (m *Menu) DrawArea() pixel.Rect
- func (m *Menu) Focus(focus bool)
- func (m *Menu) Focused() bool
- func (m *Menu) Hide()
- func (m *Menu) Opened() bool
- func (m *Menu) Show()
- func (m *Menu) Size() pixel.Vec
- func (m *Menu) Update(win *mtk.Window)
- type MenuBar
- type Message
- type MessagesByTime
- type ObjectFrame
- type ObjectInfo
- type SaveMenu
- func (sm *SaveMenu) Draw(win *mtk.Window, matrix pixel.Matrix)
- func (sm *SaveMenu) DrawArea() pixel.Rect
- func (sm *SaveMenu) Focus(focus bool)
- func (sm *SaveMenu) Focused() bool
- func (sm *SaveMenu) Hide()
- func (sm *SaveMenu) Opened() bool
- func (sm *SaveMenu) Show()
- func (sm *SaveMenu) Size() pixel.Vec
- func (sm *SaveMenu) Update(win *mtk.Window)
- type SkillMenu
- func (sm *SkillMenu) Draw(win *mtk.Window, matrix pixel.Matrix)
- func (sm *SkillMenu) DrawArea() pixel.Rect
- func (sm *SkillMenu) Focus(focus bool)
- func (sm *SkillMenu) Focused() bool
- func (sm *SkillMenu) Hide()
- func (sm *SkillMenu) Opened() bool
- func (sm *SkillMenu) Show()
- func (sm *SkillMenu) Size() pixel.Vec
- func (sm *SkillMenu) Update(win *mtk.Window)
- type TradeWindow
- func (tw *TradeWindow) Draw(win *mtk.Window, matrix pixel.Matrix)
- func (tw *TradeWindow) DrawArea() pixel.Rect
- func (tw *TradeWindow) Hide()
- func (tw *TradeWindow) Opened() bool
- func (tw *TradeWindow) SetSeller(c item.Container)
- func (tw *TradeWindow) Show()
- func (tw *TradeWindow) Size() pixel.Vec
- func (tw *TradeWindow) Update(win *mtk.Window)
- type TrainingWindow
- func (tw *TrainingWindow) Draw(win *mtk.Window, matrix pixel.Matrix)
- func (tw *TrainingWindow) DrawArea() pixel.Rect
- func (tw *TrainingWindow) Hide()
- func (tw *TrainingWindow) Opened() bool
- func (tw *TrainingWindow) SetTrainer(t training.Trainer)
- func (tw *TrainingWindow) Show()
- func (tw *TrainingWindow) Size() pixel.Vec
- func (tw *TrainingWindow) Update(win *mtk.Window)
Constants ¶
const ( LootRange = 50 DialogRange = 50 ActionRange = 50 )
Variables ¶
var (
FOWColor pixel.RGBA = pixel.RGBA{0.1, 0.1, 0.1, 0.7}
)
Functions ¶
This section is empty.
Types ¶
type Camera ¶
type Camera struct {
// contains filtered or unexported fields
}
Struct for HUD camera.
func (*Camera) ConvCameraPos ¶
ConvCameraPos translates specified camera position to area position.
func (*Camera) SetPosition ¶
SetPosition sets camera position.
type CastBar ¶
type CastBar struct {
// contains filtered or unexported fields
}
Struct for HUD cast bar. TODO: bar background.
type CharacterWindow ¶
type CharacterWindow struct {
// contains filtered or unexported fields
}
Struct for HUD character window.
func (*CharacterWindow) Draw ¶
func (cw *CharacterWindow) Draw(win *mtk.Window, matrix pixel.Matrix)
Draw draws window.
func (*CharacterWindow) DrawArea ¶
func (cw *CharacterWindow) DrawArea() pixel.Rect
DrawArea returns window draw area.
func (*CharacterWindow) Opened ¶
func (cw *CharacterWindow) Opened() bool
Opened checks if window is open.
func (*CharacterWindow) Size ¶
func (cw *CharacterWindow) Size() pixel.Vec
Size returns window background size.
func (*CharacterWindow) Update ¶
func (cw *CharacterWindow) Update(win *mtk.Window)
Update updates window.
type Chat ¶
type Chat struct {
// contains filtered or unexported fields
}
Chat represents HUD chat window.
type CombatLogger ¶
Interface for objects with combat log.
type CraftingMenu ¶
type CraftingMenu struct {
// contains filtered or unexported fields
}
Struct for HUD crafting menu.
func (*CraftingMenu) Draw ¶
func (cm *CraftingMenu) Draw(win *mtk.Window, matrix pixel.Matrix)
Draw draws menu.
func (*CraftingMenu) DrawArea ¶
func (cm *CraftingMenu) DrawArea() pixel.Rect
DrawArea returns current draw area.
func (*CraftingMenu) Size ¶
func (cm *CraftingMenu) Size() pixel.Vec
Size returns menu background size.
type DialogWindow ¶
type DialogWindow struct {
// contains filtered or unexported fields
}
Struct for HUD dialog window.
func (*DialogWindow) Draw ¶
func (dw *DialogWindow) Draw(win *mtk.Window, matrix pixel.Matrix)
Draw draws window.
func (*DialogWindow) DrawArea ¶
func (dw *DialogWindow) DrawArea() pixel.Rect
DrawArea returns current draw area.
func (*DialogWindow) Opened ¶
func (dw *DialogWindow) Opened() bool
Opened checks if window is open.
func (*DialogWindow) SetDialog ¶
func (dw *DialogWindow) SetDialog(d *dialog.Dialog)
SetDialog sets dialog for window.
func (*DialogWindow) Update ¶
func (dw *DialogWindow) Update(win *mtk.Window)
Updates updates window.
type FrameTarget ¶
type FrameTarget interface { Name() string Health() int MaxHealth() int Mana() int MaxMana() int Portrait() pixel.Picture Effects() []*object.EffectGraphic }
Interface for HUD frame object.
type HUD ¶
type HUD struct {
// contains filtered or unexported fields
}
Struct for 'head-up display'.
func (*HUD) ChangeArea ¶
ChangeArea changes current HUD area.
func (*HUD) CloseLoadingScreen ¶
func (hud *HUD) CloseLoadingScreen()
Close loading screen closes loading screen.
func (*HUD) Layout ¶
Layout returns layout for player with specified ID serial value(creates new layout if there is no saved layout for such player).
func (*HUD) OpenLoadingScreen ¶
OpenLoadingScreen opens loading screen with specified loading information.
func (*HUD) RunScript ¶
RunScript executes specified script, in case of error sends err message to Mural error log.
func (*HUD) SetActiveChar ¶
SetActiveChar sets specified game character as active character.
func (*HUD) SetOnAreaChangedFunc ¶
SetOnAreaChangedFunc sets function triggered on area change.
func (*HUD) ShowMessage ¶
func (hud *HUD) ShowMessage(msg *mtk.MessageWindow)
ShowMessage displays specified message window in HUD messages queue.
type InfoTarget ¶
Interface for object info targets.
type InventoryMenu ¶
type InventoryMenu struct {
// contains filtered or unexported fields
}
Struct for inventory menu.
func (*InventoryMenu) Draw ¶
func (im *InventoryMenu) Draw(win *mtk.Window, matrix pixel.Matrix)
Draw draws menu.
func (*InventoryMenu) DrawArea ¶
func (im *InventoryMenu) DrawArea() pixel.Rect
DrawArea returns current menu draw area.
func (*InventoryMenu) Focused ¶
func (im *InventoryMenu) Focused() bool
Focused checks whether menu is focused.
func (*InventoryMenu) Opened ¶
func (im *InventoryMenu) Opened() bool
Opened checks whether menu is open.
func (*InventoryMenu) Size ¶
func (im *InventoryMenu) Size() pixel.Vec
Size returns size of menu background.
func (*InventoryMenu) Update ¶
func (im *InventoryMenu) Update(win *mtk.Window)
Update updates menu.
type JournalWindow ¶
type JournalWindow struct {
// contains filtered or unexported fields
}
Struct for HUD journal window.
func (*JournalWindow) Draw ¶
func (jw *JournalWindow) Draw(win *mtk.Window, matrix pixel.Matrix)
Draw draws window.
func (*JournalWindow) DrawArea ¶
func (jw *JournalWindow) DrawArea() pixel.Rect
DrawArea returns window draw area.
func (*JournalWindow) Opened ¶
func (jw *JournalWindow) Opened() bool
Opened checks if window is open.
func (*JournalWindow) Update ¶
func (jw *JournalWindow) Update(win *mtk.Window)
Update updates window.
type Layout ¶
type Layout struct {
// contains filtered or unexported fields
}
Struct for HUD layout. Stores layout of items and skills in menu bar and inventory menu.
func (*Layout) SaveBarSlot ¶
SaveBarSlot saves position(slot ID) of specified object at menu bar.
func (*Layout) SaveInvSlot ¶
func (l *Layout) SaveInvSlot(ob *object.ItemGraphic, slotID int)
SaveInvSlot saves position(slot ID) of specified item at inventory slot list.
func (*Layout) SetBarSlots ¶
SetBarSlot sets specified layout map as current menu bar slots content layout.
func (*Layout) SetInvSlots ¶
SetInvSlots sets specified layout map as current inventory slots content layout.
type LoadingScreen ¶
type LoadingScreen struct {
// contains filtered or unexported fields
}
Struct for HUD loading screen.
func (*LoadingScreen) Draw ¶
func (ls *LoadingScreen) Draw(win *mtk.Window)
Draw draws loading screen.
func (*LoadingScreen) SetLoadInfo ¶
func (ls *LoadingScreen) SetLoadInfo(text string)
SetLoadInfo sets specified text as current load info text.
func (*LoadingScreen) Update ¶
func (ls *LoadingScreen) Update(win *mtk.Window)
Update updates loading screen.
type LootWindow ¶
type LootWindow struct {
// contains filtered or unexported fields
}
Struct for HUD loot window.
func (*LootWindow) Draw ¶
func (lw *LootWindow) Draw(win *mtk.Window, matrix pixel.Matrix)
Draw draws window.
func (*LootWindow) DrawArea ¶
func (lw *LootWindow) DrawArea() pixel.Rect
DrawArea returns current draw area of window background.
func (*LootWindow) Focused ¶
func (lw *LootWindow) Focused() bool
Focused checks whether window is focused.
func (*LootWindow) Opened ¶
func (lw *LootWindow) Opened() bool
Opened checks whether window is open.
func (*LootWindow) SetTarget ¶
func (lw *LootWindow) SetTarget(t LootTarget)
SetTarget sets object with inventory to loot.
func (*LootWindow) Size ¶
func (lw *LootWindow) Size() pixel.Vec
Size returns size of loot window background.
type Menu ¶
type Menu struct {
// contains filtered or unexported fields
}
Struct for HUD menu.
type MenuBar ¶
type MenuBar struct {
// contains filtered or unexported fields
}
Struct for HUD menu bar.
type Message ¶
type Message struct {
// contains filtered or unexported fields
}
Struct for log message.
type MessagesByTime ¶
type MessagesByTime []Message
Struct for sorting messages by the messsage time.
func (MessagesByTime) Len ¶
func (mbt MessagesByTime) Len() int
func (MessagesByTime) Less ¶
func (mbt MessagesByTime) Less(i, j int) bool
func (MessagesByTime) Swap ¶
func (mbt MessagesByTime) Swap(i, j int)
type ObjectFrame ¶
type ObjectFrame struct {
// contains filtered or unexported fields
}
Struct for object frame with portrait, health/mana bars and effects icons.
func (*ObjectFrame) Draw ¶
func (of *ObjectFrame) Draw(win *mtk.Window, matrix pixel.Matrix)
Draw draws character frame.
func (*ObjectFrame) DrawArea ¶
func (of *ObjectFrame) DrawArea() pixel.Rect
DrawArea retruns current frame draw area.
func (*ObjectFrame) SetObject ¶
func (of *ObjectFrame) SetObject(ob FrameTarget)
SetObject sets specified object as object to display in frame.
func (*ObjectFrame) Size ¶
func (of *ObjectFrame) Size() pixel.Vec
Size returns size of character frame background.
func (*ObjectFrame) Update ¶
func (of *ObjectFrame) Update(win *mtk.Window)
Update updates character frame.
type ObjectInfo ¶
type ObjectInfo struct {
// contains filtered or unexported fields
}
Struct for HUD object info window.
func (*ObjectInfo) Open ¶
func (oi *ObjectInfo) Open(open bool)
SetOpen toggles info window visibility.
func (*ObjectInfo) Opened ¶
func (oi *ObjectInfo) Opened() bool
Opened checks if object info is open.
func (*ObjectInfo) SetObject ¶
func (oi *ObjectInfo) SetObject(ob InfoTarget)
SetObject sets specified object for object info.
func (*ObjectInfo) Update ¶
func (oi *ObjectInfo) Update(win *mtk.Window)
Update updates object info.
type SaveMenu ¶
type SaveMenu struct {
// contains filtered or unexported fields
}
Struct for HUD save game menu.
type SkillMenu ¶
type SkillMenu struct {
// contains filtered or unexported fields
}
Struct for skills menu.
type TradeWindow ¶
type TradeWindow struct {
// contains filtered or unexported fields
}
Struct for HUD trade window.
func (*TradeWindow) Draw ¶
func (tw *TradeWindow) Draw(win *mtk.Window, matrix pixel.Matrix)
Draw draws window.
func (*TradeWindow) DrawArea ¶
func (tw *TradeWindow) DrawArea() pixel.Rect
DrawArea returns window draw area.
func (*TradeWindow) SetSeller ¶
func (tw *TradeWindow) SetSeller(c item.Container)
SetSeller sets c as seller.
func (*TradeWindow) Size ¶
func (tw *TradeWindow) Size() pixel.Vec
Size returns window background size.
type TrainingWindow ¶
type TrainingWindow struct {
// contains filtered or unexported fields
}
Struct for HUD training window.
func (*TrainingWindow) Draw ¶
func (tw *TrainingWindow) Draw(win *mtk.Window, matrix pixel.Matrix)
Draw draws window.
func (*TrainingWindow) DrawArea ¶
func (tw *TrainingWindow) DrawArea() pixel.Rect
DrawArea returns window draw area.
func (*TrainingWindow) Opened ¶
func (tw *TrainingWindow) Opened() bool
Opened checks if window is open.
func (*TrainingWindow) SetTrainer ¶
func (tw *TrainingWindow) SetTrainer(t training.Trainer)
SetTrainer sets trainer for window.
func (*TrainingWindow) Size ¶
func (tw *TrainingWindow) Size() pixel.Vec
Size returns window background size.
func (*TrainingWindow) Update ¶
func (tw *TrainingWindow) Update(win *mtk.Window)
Update updates window.