Documentation ¶
Index ¶
- Constants
- func DefaultEffectGraphic(eff *effect.Effect) *res.EffectGraphicData
- func DefaultItemGraphic(it item.Item) *res.ItemGraphicData
- func DefaultSkillGraphic(skill *skill.Skill) *res.SkillGraphicData
- type Area
- type Avatar
- func (av *Avatar) Data() res.AvatarData
- func (av *Avatar) DestPoint() pixel.Vec
- func (av *Avatar) Draw(win *mtk.Window, matrix pixel.Matrix)
- func (av *Avatar) DrawArea() pixel.Rect
- func (av *Avatar) Effects() (effects []*EffectGraphic)
- func (av *Avatar) Hovered() bool
- func (av *Avatar) Portrait() pixel.Picture
- func (av *Avatar) Position() pixel.Vec
- func (av *Avatar) SetPosition(p pixel.Vec)
- func (av *Avatar) Silence(silence bool)
- func (av *Avatar) Silenced() bool
- func (av *Avatar) Skills() (skills []*SkillGraphic)
- func (av *Avatar) Update(win *mtk.Window)
- type AvatarAnimType
- type Drawer
- type EffectGraphic
- type ItemGraphic
- type ObjectGraphic
- func (og *ObjectGraphic) CombatLog() *objects.Log
- func (og *ObjectGraphic) Draw(t pixel.Target, matrix pixel.Matrix)
- func (og *ObjectGraphic) DrawArea() pixel.Rect
- func (og *ObjectGraphic) Effects() []*EffectGraphic
- func (og *ObjectGraphic) Hovered() bool
- func (og *ObjectGraphic) Items() (items []*ItemGraphic)
- func (og *ObjectGraphic) LootItems() (items []*ItemGraphic)
- func (og *ObjectGraphic) MaxMana() int
- func (og *ObjectGraphic) Name() string
- func (og *ObjectGraphic) Portrait() pixel.Picture
- func (og *ObjectGraphic) Position() pixel.Vec
- func (og *ObjectGraphic) Silence(silence bool)
- func (og *ObjectGraphic) Silenced() bool
- func (og *ObjectGraphic) Update(win *mtk.Window)
- type SkillGraphic
Constants ¶
const ( // Animation types. AvatarIdle AvatarAnimType = AvatarAnimType("idle") AvatarMove = AvatarAnimType("move") AvatarSpellCast = AvatarAnimType("spell") AvatarCraftCast = AvatarAnimType("craft") AvatarMelee = AvatarAnimType("melee") AvatarShoot = AvatarAnimType("shoot") AvatarKneel = AvatarAnimType("kneel") AvatarLie = AvatarAnimType("lie") )
Variables ¶
This section is empty.
Functions ¶
func DefaultEffectGraphic ¶
func DefaultEffectGraphic(eff *effect.Effect) *res.EffectGraphicData
DefaultEffectGraphic returns default graphic for specified effect.
func DefaultItemGraphic ¶
func DefaultItemGraphic(it item.Item) *res.ItemGraphicData
DefaultItemGraphic returns default graphic for specified item.
func DefaultSkillGraphic ¶
func DefaultSkillGraphic(skill *skill.Skill) *res.SkillGraphicData
DefaultSkillGraphic returns default graphic for specified skill.
Types ¶
type Area ¶
Graphical wrapper for area.
func (*Area) AreaObjects ¶
func (a *Area) AreaObjects() (objects []*ObjectGraphic)
AreaObjects returns all objects in current area.
func (*Area) PassablePosition ¶
PassablePosition checks if specified position is 'passable', i.e. map there is visible layer on this position where player is allowed to move(like 'ground' layer').
type Avatar ¶
Avatar struct for graphical representation of game objects with multiple directional animations(idle, move, cast, meele, etc.).
func NewAvatar ¶
NewAvatar creates new avatar for specified game character from specified avatar resources. Returns error if spritesheets from data object(torso/head or full body) were not found in res/graphic avatar spritesheet map.
func (*Avatar) Effects ¶
func (av *Avatar) Effects() (effects []*EffectGraphic)
Effects returns all visible effects active on avatar character.
func (*Avatar) SetPosition ¶
SetPosition sets current position of avatar.
func (*Avatar) Skills ¶
func (av *Avatar) Skills() (skills []*SkillGraphic)
Skills retruns all avatar skills(in form of graphical wrappers).
type EffectGraphic ¶
Graphical wrapper for effects.
func NewEffectGraphic ¶
func NewEffectGraphic(effect *effect.Effect, data *res.EffectGraphicData) *EffectGraphic
NewEffectGraphic creates new graphical wrapper for specified effect.
func (*EffectGraphic) DrawIcon ¶
func (eg *EffectGraphic) DrawIcon(t pixel.Target, matrix pixel.Matrix)
DrawIcon draws effect icon and text label with remaining time(in seconds).
func (*EffectGraphic) Icon ¶
func (eg *EffectGraphic) Icon() *pixel.Sprite
Icon returns effect icon.
type ItemGraphic ¶
Struct for graphical wrapper for items.
func NewItemGraphic ¶
func NewItemGraphic(item item.Item, data *res.ItemGraphicData) *ItemGraphic
NewItemGraphic creates new graphical wrapper for specified item.
func (*ItemGraphic) MaxStack ¶
func (itg *ItemGraphic) MaxStack() int
MaxStack returns maximal number of stacked items with same ID.
func (*ItemGraphic) Spritesheets ¶
func (itg *ItemGraphic) Spritesheets() []*res.SpritesheetData
Spritesheets returns all spritesheets data.
type ObjectGraphic ¶
Struct for graphical representation of area object with single idle animation.
func NewObjectGraphic ¶
func NewObjectGraphic(char *character.Character, data *res.ObjectGraphicData) (*ObjectGraphic, error)
NewObjectGraphic creates new object graphic for specified character. Returns error if sprite texture from data object was not found it res/graphic object spritesheets map.
func (*ObjectGraphic) CombatLog ¶
func (og *ObjectGraphic) CombatLog() *objects.Log
ComabatLog retruns object comabt log.
func (*ObjectGraphic) Draw ¶
func (og *ObjectGraphic) Draw(t pixel.Target, matrix pixel.Matrix)
Draw draws object sprite.
func (*ObjectGraphic) DrawArea ¶
func (og *ObjectGraphic) DrawArea() pixel.Rect
DrawArea returns current draw area of object sprite.
func (*ObjectGraphic) Effects ¶
func (og *ObjectGraphic) Effects() []*EffectGraphic
Effects returns all object effects in form of graphical wrappers.
func (*ObjectGraphic) Hovered ¶
func (og *ObjectGraphic) Hovered() bool
Hovered checks if object is hovered by HUD user mouse cursor.
func (*ObjectGraphic) Items ¶
func (og *ObjectGraphic) Items() (items []*ItemGraphic)
Items returns all object items(in form of graphical wrappers).
func (*ObjectGraphic) LootItems ¶
func (og *ObjectGraphic) LootItems() (items []*ItemGraphic)
LootItems returns all 'lootable' items(in form of graphical wrappers).
func (*ObjectGraphic) MaxMana ¶
func (og *ObjectGraphic) MaxMana() int
MaxMana returns 0, object do not have mana. Function to satify frame target interface.
func (*ObjectGraphic) Portrait ¶
func (og *ObjectGraphic) Portrait() pixel.Picture
Portrait returns portrait picture.
func (*ObjectGraphic) Position ¶
func (og *ObjectGraphic) Position() pixel.Vec
Position return object position in form of pixel XY vector.
func (*ObjectGraphic) Silence ¶
func (og *ObjectGraphic) Silence(silence bool)
Silence toggles object audio effects.
func (*ObjectGraphic) Silenced ¶
func (og *ObjectGraphic) Silenced() bool
Silenced checks if audio effects are silenced.
func (*ObjectGraphic) Update ¶
func (og *ObjectGraphic) Update(win *mtk.Window)
Update updates object.
type SkillGraphic ¶
Graphical wrapper for skills.
func NewSkillGraphic ¶
func NewSkillGraphic(skill *skill.Skill, data *res.SkillGraphicData) *SkillGraphic
NewSkillGraphic creates new graphical wrapper for specified skill.
func (*SkillGraphic) ActivationAnim ¶
func (sg *SkillGraphic) ActivationAnim() AvatarAnimType
ActivationAnim returns skill activation animation.
func (*SkillGraphic) ActivationAudio ¶
func (sg *SkillGraphic) ActivationAudio() *beep.Buffer
AudioEffect returns skill audio effect.
func (*SkillGraphic) Icon ¶
func (sg *SkillGraphic) Icon() pixel.Picture
Icon returns skill icon sprite.