Documentation ¶
Index ¶
- type AvatarBodyPart
- func (abp *AvatarBodyPart) Down()
- func (abp *AvatarBodyPart) Draw(t pixel.Target, matrix pixel.Matrix)
- func (abp *AvatarBodyPart) DrawArea() pixel.Rect
- func (abp *AvatarBodyPart) DrawColorMask(t pixel.Target, matrix pixel.Matrix, col color.Color)
- func (abp *AvatarBodyPart) Idle()
- func (abp *AvatarBodyPart) Kneel()
- func (abp *AvatarBodyPart) Left()
- func (abp *AvatarBodyPart) Lie()
- func (abp *AvatarBodyPart) Melee()
- func (abp *AvatarBodyPart) MeleeOnce()
- func (abp *AvatarBodyPart) Move()
- func (abp *AvatarBodyPart) Right()
- func (abp *AvatarBodyPart) Shoot()
- func (abp *AvatarBodyPart) ShootOnce()
- func (abp *AvatarBodyPart) SpellCast()
- func (abp *AvatarBodyPart) Up()
- func (abp *AvatarBodyPart) Update(win *mtk.Window)
- type AvatarSprite
- func (as *AvatarSprite) Clear()
- func (as *AvatarSprite) CraftCast()
- func (as *AvatarSprite) Down()
- func (as *AvatarSprite) Draw(t pixel.Target, matrix pixel.Matrix)
- func (as *AvatarSprite) DrawArea() pixel.Rect
- func (as *AvatarSprite) DrawColorMask(t pixel.Target, matrix pixel.Matrix, col color.Color)
- func (as *AvatarSprite) Idle()
- func (as *AvatarSprite) Kneel()
- func (as *AvatarSprite) Left()
- func (as *AvatarSprite) Lie()
- func (as *AvatarSprite) Melee()
- func (as *AvatarSprite) MeleeOnce()
- func (as *AvatarSprite) Move()
- func (as *AvatarSprite) Right()
- func (as *AvatarSprite) SetFullBody(spritesheet pixel.Picture)
- func (as *AvatarSprite) SetHead(spritesheet pixel.Picture)
- func (as *AvatarSprite) SetTorso(spritesheet pixel.Picture)
- func (as *AvatarSprite) SetWeapon(spritesheet pixel.Picture)
- func (as *AvatarSprite) Shoot()
- func (as *AvatarSprite) ShootOnce()
- func (as *AvatarSprite) SpellCast()
- func (as *AvatarSprite) Up()
- func (as *AvatarSprite) Update(win *mtk.Window)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AvatarBodyPart ¶
type AvatarBodyPart struct {
// contains filtered or unexported fields
}
Struct for avatar sprite body part (e.g. body, head, weapon). TODO: animations for kneel and lie.
func (*AvatarBodyPart) Draw ¶
func (abp *AvatarBodyPart) Draw(t pixel.Target, matrix pixel.Matrix)
Draw draws current body animation.
func (*AvatarBodyPart) DrawArea ¶
func (abp *AvatarBodyPart) DrawArea() pixel.Rect
DrawArea returns current draw area.
func (*AvatarBodyPart) DrawColorMask ¶
DrawColorMask draws current body animation with specified color mask.
func (*AvatarBodyPart) Idle ¶
func (abp *AvatarBodyPart) Idle()
Idle sets idle animation as current draw animation.
func (*AvatarBodyPart) Kneel ¶
func (abp *AvatarBodyPart) Kneel()
Kneel sets kneel animtaion as current draw animation.
func (*AvatarBodyPart) Lie ¶
func (abp *AvatarBodyPart) Lie()
Lie sets lie animation as current draw animation.
func (*AvatarBodyPart) Melee ¶
func (abp *AvatarBodyPart) Melee()
Melee sets melee animation as current draw animation.
func (*AvatarBodyPart) MeleeOnce ¶
func (abp *AvatarBodyPart) MeleeOnce()
MeleeOnce restarts and sets melee animation as secondary animation to show only once.
func (*AvatarBodyPart) Move ¶
func (abp *AvatarBodyPart) Move()
Move sets move animation as current draw animation.
func (*AvatarBodyPart) Right ¶
func (abp *AvatarBodyPart) Right()
Right turns current animataion right.
func (*AvatarBodyPart) Shoot ¶
func (abp *AvatarBodyPart) Shoot()
Shoot sets shoot animation as current draw animation.
func (*AvatarBodyPart) ShootOnce ¶
func (abp *AvatarBodyPart) ShootOnce()
ShootOnce restarts and sets shoot animation as secondary animation to show only once.
func (*AvatarBodyPart) SpellCast ¶
func (abp *AvatarBodyPart) SpellCast()
SpellCast sets spell cast animation as current draw animation.
func (*AvatarBodyPart) Update ¶
func (abp *AvatarBodyPart) Update(win *mtk.Window)
Update updates current body animation.
type AvatarSprite ¶
type AvatarSprite struct {
// contains filtered or unexported fields
}
Struct for avatar sprite animations.
func NewAvatarSprite ¶
func NewAvatarSprite(bodySpritesheet, headSpritesheet pixel.Picture) *AvatarSprite
NewAvatarSprite creates new sprite for specified body and head spritesheets.
func NewFullBodyAvatarSprite ¶
func NewFullBodyAvatarSprite(spritesheet pixel.Picture) *AvatarSprite
NewFullBodyAvatarSprite creates new sprite with only one full body animated part.
func (*AvatarSprite) Clear ¶
func (as *AvatarSprite) Clear()
Clear sets base body parts as current body parts.
func (*AvatarSprite) CraftCast ¶
func (as *AvatarSprite) CraftCast()
CraftCast sets craft cast animations as current draw animations.
func (*AvatarSprite) Draw ¶
func (as *AvatarSprite) Draw(t pixel.Target, matrix pixel.Matrix)
Draw draws current sprite elements.
func (*AvatarSprite) DrawArea ¶
func (as *AvatarSprite) DrawArea() pixel.Rect
DrawArea returns current draw area.
func (*AvatarSprite) DrawColorMask ¶
DrawColorMask draws current sprite elements with specified color mask.
func (*AvatarSprite) Idle ¶
func (as *AvatarSprite) Idle()
Idle sets idle animations as current draw animations.
func (*AvatarSprite) Kneel ¶
func (as *AvatarSprite) Kneel()
Kneel sets kneel animations as current draw animtaions.
func (*AvatarSprite) Lie ¶
func (as *AvatarSprite) Lie()
Lie sets lie animations as current draw animtaions.
func (*AvatarSprite) Melee ¶
func (as *AvatarSprite) Melee()
Melee sets melee animations as current draw animations.
func (*AvatarSprite) MeleeOnce ¶
func (as *AvatarSprite) MeleeOnce()
MeleeOnce starts one melee animation for all sprite parts.
func (*AvatarSprite) Move ¶
func (as *AvatarSprite) Move()
Move sets move animations as current draw animations.
func (*AvatarSprite) Right ¶
func (as *AvatarSprite) Right()
Right turns all current animataions right.
func (*AvatarSprite) SetFullBody ¶
func (as *AvatarSprite) SetFullBody(spritesheet pixel.Picture)
SetFullBody creates new full body animations from specified avatar spritesheet.
func (*AvatarSprite) SetHead ¶
func (as *AvatarSprite) SetHead(spritesheet pixel.Picture)
SetHead creates head animations from specified avatar spritesheet.
func (*AvatarSprite) SetTorso ¶
func (as *AvatarSprite) SetTorso(spritesheet pixel.Picture)
SetTorso creates body animations from specified avatar spritesheet.
func (*AvatarSprite) SetWeapon ¶
func (as *AvatarSprite) SetWeapon(spritesheet pixel.Picture)
SetWeapon creates new weapon animations from specified avatar spritesheet.
func (*AvatarSprite) Shoot ¶
func (as *AvatarSprite) Shoot()
Shoot sets shoot animations as current draw animations.
func (*AvatarSprite) ShootOnce ¶
func (as *AvatarSprite) ShootOnce()
ShootOnce starts one shoot animation for all sprite parts.
func (*AvatarSprite) SpellCast ¶
func (as *AvatarSprite) SpellCast()
SpellCast sets spell cast animations as current draw animations.
func (*AvatarSprite) Update ¶
func (as *AvatarSprite) Update(win *mtk.Window)
Update updates current sprite elements.