Documentation ¶
Index ¶
- func DetectSpritesheet(path, root string) (name string, w, h int, ok bool)
- func Pack(data Data) (width, height int)
- type Data
- func (d *Data) AddImages(paths ...string) error
- func (v *Data) AddMarkdown(m *txt.Markdown)
- func (v *Data) BiInsert(value PicData, cmp func(a, b PicData) uint8)
- func (v Data) BiSearch(value PicData, cmp func(a, b PicData) uint8) (int, bool)
- func (v *Data) Clear()
- func (v Data) Clone() Data
- func (v *Data) Extend(amount int)
- func (v *Data) Filter(filter func(e PicData) bool)
- func (v Data) Find(find func(e PicData) bool) (idx int, res PicData)
- func (v Data) ForEach(con func(i int, e PicData) PicData)
- func (v *Data) Insert(idx int, val PicData)
- func (v *Data) InsertSlice(idx int, val []PicData)
- func (v Data) Last() PicData
- func (v Data) Len() int
- func (v Data) Move(old, new int)
- func (v *Data) Pop() PicData
- func (v *Data) PopFront() PicData
- func (v *Data) Remove(idx int) (val PicData)
- func (v *Data) RemoveSlice(start, end int)
- func (v Data) Reverse()
- func (v Data) Rewrite(o Data, idx int)
- func (v Data) Sort(comp func(a, b PicData) bool)
- func (v Data) Swap(a, b int)
- func (v *Data) Truncate(l int)
- func (v *Data) UClear()
- type PicData
- type Sheet
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DetectSpritesheet ¶
DetectSpritesheet parses name of texture into spritesheet if name is in format:
name_width_height.ext
where width hight are parameters of one sheet cell
Types ¶
type Data ¶
type Data []PicData
Data is a standard Vector type with utility methods
func (*Data) AddImages ¶
NPicData creates Slice of PicData from texture paths, it flips the textures so they are not upside down
func (*Data) AddMarkdown ¶
AddMarkdown adds markdown font textures into Data
func (*Data) BiInsert ¶
BiInsert inserts inserts value in a way that keeps vec sorted, binary search is used to determinate where to insert
func (Data) BiSearch ¶
BiSearch performs a binary search on Ves assuming it is sorted. cmp consumer should return 0 if a == b equal, 1 if a > b and 2 if b > a, even if value wos not found it returns it returns closest index and false. If Data is empty -1 and false is returned
func (Data) Find ¶
Find returns first element for which find returns true along with index, if there is none, index equals -1
func (*Data) InsertSlice ¶
InsertSlice inserts slice to given index
func (*Data) RemoveSlice ¶
RemoveSlice removes sequence of slice
func (Data) Sort ¶
Sort is quicksort for Data, because this is part of a template comp function is necessary
type Sheet ¶
Sheet contains sprite sheet and Regions
func (*Sheet) Batch ¶ added in v0.2.8
Batch returns batch for this sheet that can be used with sprites
func (*Sheet) Pack ¶
func (s *Sheet) Pack()
Pack takes all Data in sheet and translates it into one packed image and regions, regarding the current Root the names will be modified, for example if root is "root" then "something/root/anything.png" will be saved under kay with value "anything" into s.Regions