Documentation ¶
Index ¶
- Constants
- Variables
- type App
- type BaseApp
- type BaseComponent
- type BaseEventNotifier
- type BaseResources
- type BaseScene
- func (s *BaseScene) AddComponent(c Component)
- func (s *BaseScene) Delete(r Resources)
- func (s *BaseScene) GetID() SceneID
- func (s *BaseScene) Load(r Resources) (err error)
- func (s *BaseScene) Render()
- func (s *BaseScene) SetID(id SceneID)
- func (s *BaseScene) Unload()
- func (s *BaseScene) Update(mgr SceneManager)
- type BaseSceneManager
- func (m *BaseSceneManager) AddScene(s Scene) (err error)
- func (m *BaseSceneManager) Delete()
- func (m *BaseSceneManager) Head() *SceneNode
- func (m *BaseSceneManager) Load(r Resources) (err error)
- func (m *BaseSceneManager) OnSceneLoaded(event SceneLoadedEvent)
- func (m *BaseSceneManager) OnSceneUnload(event SceneUnloadEvent)
- func (m *BaseSceneManager) Render()
- func (m *BaseSceneManager) Update()
- type Component
- type ComponentID
- type Event
- type EventNotifier
- type EventObserver
- type EventObserverID
- type EventObserverList
- type EventObserverListID
- type EventObserverNode
- type GeometryType
- type ResourceKey
- type ResourceLoader
- type ResourceType
- type Resources
- type Scene
- type SceneEventNotifier
- type SceneEventObserver
- type SceneID
- type SceneList
- type SceneListID
- type SceneLoadedEvent
- type SceneManager
- type SceneNode
- type SceneUnloadEvent
- type SheetType
- type Something
- type SomethingList
- type SomethingListID
- type SomethingNode
- type TexturePackerSheetLoader
- type TextureSmoothing
Constants ¶
const ( SmoothingNearest = TextureSmoothing(core.SmoothingNearest) SmoothingLinear = TextureSmoothing(core.SmoothingLinear) )
Variables ¶
var ErrEventObserverNotInList = fmt.Errorf("Could not find item in list")
var ErrSceneNotInList = fmt.Errorf("Could not find item in list")
var ErrSomethingNotInList = fmt.Errorf("Could not find item in list")
Functions ¶
This section is empty.
Types ¶
type BaseApp ¶
type BaseApp struct { WindowWidth int WindowHeight int WindowTitle string SceneManager SceneManager Resources Resources }
type BaseComponent ¶
type BaseComponent struct {
// contains filtered or unexported fields
}
func (*BaseComponent) GetID ¶
func (c *BaseComponent) GetID() ComponentID
func (*BaseComponent) SetScene ¶
func (c *BaseComponent) SetScene(s Scene)
type BaseEventNotifier ¶
type BaseEventNotifier struct {
// contains filtered or unexported fields
}
func NewBaseEventNotifier ¶
func NewBaseEventNotifier() *BaseEventNotifier
func (*BaseEventNotifier) AddObserver ¶
func (n *BaseEventNotifier) AddObserver(obs EventObserver) (id EventObserverID)
func (*BaseEventNotifier) Delete ¶
func (n *BaseEventNotifier) Delete()
func (*BaseEventNotifier) Notify ¶
func (n *BaseEventNotifier) Notify(event Event)
func (*BaseEventNotifier) RemoveObserver ¶
func (n *BaseEventNotifier) RemoveObserver(id EventObserverID) (err error)
type BaseResources ¶
type BaseResources struct {
// contains filtered or unexported fields
}
func NewBaseResources ¶
func NewBaseResources() *BaseResources
func (*BaseResources) Delete ¶
func (r *BaseResources) Delete()
func (*BaseResources) Get ¶
func (r *BaseResources) Get(loader ResourceLoader) (res ResourceType, err error)
func (*BaseResources) Release ¶
func (r *BaseResources) Release(key ResourceKey) (err error)
type BaseScene ¶
type BaseScene struct {
// contains filtered or unexported fields
}
func NewBaseScene ¶
func NewBaseScene() *BaseScene
func (*BaseScene) AddComponent ¶
func (*BaseScene) Update ¶
func (s *BaseScene) Update(mgr SceneManager)
type BaseSceneManager ¶
type BaseSceneManager struct {
// contains filtered or unexported fields
}
func NewBaseSceneManager ¶
func NewBaseSceneManager(scenes ...Scene) (m *BaseSceneManager)
func (*BaseSceneManager) AddScene ¶
func (m *BaseSceneManager) AddScene(s Scene) (err error)
func (*BaseSceneManager) Delete ¶
func (m *BaseSceneManager) Delete()
func (*BaseSceneManager) Head ¶
func (m *BaseSceneManager) Head() *SceneNode
func (*BaseSceneManager) Load ¶
func (m *BaseSceneManager) Load(r Resources) (err error)
func (*BaseSceneManager) OnSceneLoaded ¶
func (m *BaseSceneManager) OnSceneLoaded(event SceneLoadedEvent)
func (*BaseSceneManager) OnSceneUnload ¶
func (m *BaseSceneManager) OnSceneUnload(event SceneUnloadEvent)
func (*BaseSceneManager) Render ¶
func (m *BaseSceneManager) Render()
func (*BaseSceneManager) Update ¶
func (m *BaseSceneManager) Update()
type Component ¶
type Component interface { GetID() ComponentID SetScene(s Scene) Delete() }
type ComponentID ¶
type ComponentID string
type EventNotifier ¶
type EventNotifier interface { AddObserver(obs EventObserver) (id EventObserverID) RemoveObserver(obs EventObserver) (err error) Notify(event Event) Delete() }
type EventObserver ¶
type EventObserver func(event Event)
type EventObserverID ¶
type EventObserverID int
func BindSceneEventObserver ¶
func BindSceneEventObserver(notifier EventNotifier, obs SceneEventObserver) (id EventObserverID)
type EventObserverList ¶
type EventObserverList struct {
// contains filtered or unexported fields
}
A EventObserverList manages a list of EventObserverNode items.
func NewEventObserverList ¶
func NewEventObserverList(items ...EventObserver) (l *EventObserverList)
func (*EventObserverList) Delete ¶
func (l *EventObserverList) Delete()
Unlinks all EventObserver items from this EventObserverList.
func (*EventObserverList) Head ¶
func (l *EventObserverList) Head() *EventObserverNode
func (*EventObserverList) Prepend ¶
func (l *EventObserverList) Prepend(item EventObserver) (id EventObserverListID)
func (*EventObserverList) Remove ¶
func (l *EventObserverList) Remove(id EventObserverListID) (err error)
Attempts to remove `item` from the list. Returns ErrEventObserverNotInList if the ID did not exist in list.
type EventObserverListID ¶
type EventObserverListID int
type EventObserverNode ¶
type EventObserverNode struct { EventObserver // contains filtered or unexported fields }
A EventObserverNode represents a doubly-linked EventObserver.
func (*EventObserverNode) ID ¶
func (n *EventObserverNode) ID() EventObserverListID
func (*EventObserverNode) Next ¶
func (n *EventObserverNode) Next() *EventObserverNode
func (*EventObserverNode) Unlink ¶
func (n *EventObserverNode) Unlink() (next *EventObserverNode)
Unlinks the node from the current list. Returns the next node for convenience while iterating.
type GeometryType ¶
func (GeometryType) Key ¶
func (t GeometryType) Key() ResourceKey
type ResourceKey ¶
type ResourceKey string
type ResourceLoader ¶
type ResourceLoader interface { Key() ResourceKey Load(resources Resources) (res ResourceType, err error) }
type ResourceType ¶
type ResourceType interface { Key() ResourceKey Delete() }
type Resources ¶
type Resources interface { Get(loader ResourceLoader) (res ResourceType, err error) Release(key ResourceKey) (err error) Delete() }
type SceneEventNotifier ¶
type SceneEventNotifier struct {
*BaseEventNotifier
}
func NewSceneEventNotifier ¶
func NewSceneEventNotifier() *SceneEventNotifier
func (*SceneEventNotifier) NotifySceneLoaded ¶
func (n *SceneEventNotifier) NotifySceneLoaded(scene Scene)
func (*SceneEventNotifier) NotifySceneUnload ¶
func (n *SceneEventNotifier) NotifySceneUnload(scene Scene)
type SceneEventObserver ¶
type SceneEventObserver interface { OnSceneLoaded(event SceneLoadedEvent) OnSceneUnload(event SceneUnloadEvent) }
type SceneList ¶
type SceneList struct {
// contains filtered or unexported fields
}
A SceneList manages a list of SceneNode items.
func NewSceneList ¶
func (*SceneList) Delete ¶
func (l *SceneList) Delete()
Unlinks all Scene items from this SceneList.
func (*SceneList) Prepend ¶
func (l *SceneList) Prepend(item Scene) (id SceneListID)
func (*SceneList) Remove ¶
func (l *SceneList) Remove(id SceneListID) (err error)
Attempts to remove `item` from the list. Returns ErrSceneNotInList if the ID did not exist in list.
type SceneListID ¶
type SceneListID int
type SceneLoadedEvent ¶
type SceneLoadedEvent struct {
Scene
}
Fired after the scene has finished loading all resources.
type SceneManager ¶
type SceneNode ¶
type SceneNode struct { Scene // contains filtered or unexported fields }
A SceneNode represents a doubly-linked Scene.
func (*SceneNode) ID ¶
func (n *SceneNode) ID() SceneListID
type SceneUnloadEvent ¶
type SceneUnloadEvent struct {
Scene
}
Fired before the scene starts unloading all resources.
type SomethingList ¶
type SomethingList struct {
// contains filtered or unexported fields
}
A SomethingList manages a list of SomethingNode items.
func NewSomethingList ¶
func NewSomethingList(items ...Something) (l *SomethingList)
func (*SomethingList) Delete ¶
func (l *SomethingList) Delete()
Unlinks all Something items from this SomethingList.
func (*SomethingList) Head ¶
func (l *SomethingList) Head() *SomethingNode
func (*SomethingList) Prepend ¶
func (l *SomethingList) Prepend(item Something) (id SomethingListID)
func (*SomethingList) Remove ¶
func (l *SomethingList) Remove(id SomethingListID) (err error)
Attempts to remove `item` from the list. Returns ErrSomethingNotInList if the ID did not exist in list.
type SomethingListID ¶
type SomethingListID int
type SomethingNode ¶
type SomethingNode struct { Something // contains filtered or unexported fields }
A SomethingNode represents a doubly-linked Something.
func (*SomethingNode) ID ¶
func (n *SomethingNode) ID() SomethingListID
func (*SomethingNode) Next ¶
func (n *SomethingNode) Next() *SomethingNode
func (*SomethingNode) Unlink ¶
func (n *SomethingNode) Unlink() (next *SomethingNode)
Unlinks the node from the current list. Returns the next node for convenience while iterating.
type TexturePackerSheetLoader ¶
type TexturePackerSheetLoader struct {
// contains filtered or unexported fields
}
func NewTexturePackerSheetLoader ¶
func NewTexturePackerSheetLoader(path string, smoothing TextureSmoothing) *TexturePackerSheetLoader
func (*TexturePackerSheetLoader) Key ¶
func (l *TexturePackerSheetLoader) Key() ResourceKey
func (*TexturePackerSheetLoader) Load ¶
func (l *TexturePackerSheetLoader) Load(resources Resources) (res ResourceType, err error)
type TextureSmoothing ¶
type TextureSmoothing core.TextureSmoothing