Documentation ¶
Index ¶
- Variables
- func LoadAnimationMap(path string) (map[string]Animation, error)
- func LoadMetaAnimationMap(path string) (map[string]MetaAnimationList, error)
- func NewEbitenImage(path string) *ebiten.Image
- type Animation
- func (anim Animation) Draw(target *ebiten.Image, xpos, ypos, scale, time float64)
- func (anim Animation) GetFrameRect(time float64) image.Rectangle
- func (anim Animation) GetHMirror(time float64) bool
- func (anim Animation) GetHScale(time float64) float64
- func (anim Animation) GetLength() float64
- func (anim Animation) GetRotation(time float64) float64
- func (anim Animation) GetWMirror(time float64) bool
- func (anim Animation) GetWScale(time float64) float64
- func (anim Animation) GetXOffset(time float64) float64
- func (anim Animation) GetYOffset(time float64) float64
- type AnimationDefinition
- type AnimationMapDefinition
- type AnimationPlayer
- type Font
- type MetaAnimation
- func (anim MetaAnimation) Draw(target *ebiten.Image, xpos, ypos, scale, time float64)
- func (anim MetaAnimation) GetAnimName(time float64) string
- func (anim MetaAnimation) GetLength() float64
- func (anim MetaAnimation) GetScale(time float64) float64
- func (anim MetaAnimation) GetTime(time float64) float64
- func (anim MetaAnimation) GetXOffset(time float64) float64
- func (anim MetaAnimation) GetYOffset(time float64) float64
- type MetaAnimationDefinition
- type MetaAnimationList
- type MetaAnimationMapDefinition
- type PlayableAnimation
Constants ¶
This section is empty.
Variables ¶
View Source
var ( FileSystem = os.DirFS(".") SHEET_CACHE = make(map[string]*ebiten.Image) // We never unload cached data yet, but if need be we can just clear this variable ANIMATION_MAP_CACHE = make(map[string](map[string]Animation)) // We cache the full maps too to save on json parsing and file reading META_ANIMATION_MAP_CACHE = make(map[string](map[string]MetaAnimationList)) )
Functions ¶
func LoadMetaAnimationMap ¶
func LoadMetaAnimationMap(path string) (map[string]MetaAnimationList, error)
func NewEbitenImage ¶
func NewEbitenImage(path string) *ebiten.Image
Types ¶
type Animation ¶
type Animation struct { Sheet *ebiten.Image // contains filtered or unexported fields }
func NewAnimationFromDefinition ¶
func NewAnimationFromDefinition(def AnimationDefinition, parent_path string) Animation
func (Animation) Draw ¶
TODO: currently animations are always drawn with the origin at the bottom middle of the sprite, give other options TODO: need to have draw methods actually just add to a depth sorted queue to draw with later, so we can meaningfully have a zpos
func (Animation) GetHMirror ¶
func (Animation) GetRotation ¶
func (Animation) GetWMirror ¶
func (Animation) GetXOffset ¶
func (Animation) GetYOffset ¶
type AnimationDefinition ¶
type AnimationDefinition struct { SheetPath string `json:"sheet_path"` FrameWidth int `json:"frame_width"` FrameHeight int `json:"frame_height"` FrameOffsetX int `json:"frame_offset_x"` FrameOffsetY int `json:"frame_offset_y"` Length float64 `json:"length"` Frames map[string]int `json:"frames"` XOffsets map[string]float64 `json:"x_offsets"` YOffsets map[string]float64 `json:"y_offsets"` WScales map[string]float64 `json:"w_scales"` HScales map[string]float64 `json:"h_scales"` WMirrors map[string]bool `json:"w_mirrors"` HMirrors map[string]bool `json:"h_mirrors"` Rotations map[string]float64 `json:"rotations"` }
type AnimationMapDefinition ¶
type AnimationMapDefinition struct {
Animations map[string]AnimationDefinition `json:"animations"`
}
type AnimationPlayer ¶
type AnimationPlayer struct {
// contains filtered or unexported fields
}
func NewAnimationPlayer ¶
func NewAnimationPlayer(anim PlayableAnimation, xpos, ypos, scale, time float64) AnimationPlayer
func (AnimationPlayer) Draw ¶
func (p AnimationPlayer) Draw(target *ebiten.Image, time float64) bool
type MetaAnimation ¶
type MetaAnimation struct {
// contains filtered or unexported fields
}
func (MetaAnimation) Draw ¶
func (anim MetaAnimation) Draw(target *ebiten.Image, xpos, ypos, scale, time float64)
func (MetaAnimation) GetAnimName ¶
func (anim MetaAnimation) GetAnimName(time float64) string
func (MetaAnimation) GetLength ¶
func (anim MetaAnimation) GetLength() float64
func (MetaAnimation) GetScale ¶
func (anim MetaAnimation) GetScale(time float64) float64
func (MetaAnimation) GetTime ¶
func (anim MetaAnimation) GetTime(time float64) float64
func (MetaAnimation) GetXOffset ¶
func (anim MetaAnimation) GetXOffset(time float64) float64
func (MetaAnimation) GetYOffset ¶
func (anim MetaAnimation) GetYOffset(time float64) float64
type MetaAnimationDefinition ¶
type MetaAnimationDefinition struct { Length float64 `json:"length"` AnimNames map[string]string `json:"anim_names"` XOffsets map[string]float64 `json:"x_offsets"` YOffsets map[string]float64 `json:"y_offsets"` Scales map[string]float64 `json:"scales"` Times map[string]float64 `json:"times"` // currently just functions as a time offset }
type MetaAnimationList ¶
type MetaAnimationList struct {
// contains filtered or unexported fields
}
func NewMetaAnimationFromDefinition ¶
func NewMetaAnimationFromDefinition(defs []MetaAnimationDefinition, parent_path string, anims map[string]Animation) MetaAnimationList
func (MetaAnimationList) Draw ¶
func (m MetaAnimationList) Draw(target *ebiten.Image, xpos, ypos, scale, time float64)
func (MetaAnimationList) GetLength ¶
func (m MetaAnimationList) GetLength() float64
type MetaAnimationMapDefinition ¶
type MetaAnimationMapDefinition struct { AnimationsPath string `json:"animations_path"` MetaAnimations map[string][]MetaAnimationDefinition `json:"meta_animations"` }
Click to show internal directories.
Click to hide internal directories.