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) Moving() 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 Greeting
- type ItemGraphic
- 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) 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 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.