Documentation ¶
Index ¶
- func LogDebug(format string, a ...interface{})
- func LogError(format string, a ...interface{})
- type Driver
- type Simra
- func (simra *Simra) AddSprite(assetName string, rect image.Rectangle, s *Sprite)
- func (simra *Simra) AddTouchListener(listener peer.TouchListener)
- func (simra *Simra) RemoveSprite(s *Sprite)
- func (simra *Simra) RemoveTouchListener(listener peer.TouchListener)
- func (simra *Simra) SetDesiredScreenSize(w, h float32)
- func (simra *Simra) SetScene(driver Driver)
- func (simra *Simra) Start(onStart, onStop chan bool)
- type Sprite
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Driver ¶
type Driver interface { // Initialize is called to initialize scene. Initialize() // Drive is called about 60 times per 1 sec. // It is the chance to update sprite information like // position, appear/disapper, and change scene. Drive() }
Driver represents a scene driver.
type Simra ¶
type Simra struct {
// contains filtered or unexported fields
}
Simra is a struct that provides API interface of simra
func GetInstance ¶
func GetInstance() *Simra
GetInstance returns instance of Simra. It is necessary to call this function to get Simra instance since Simra is single instance.
func (*Simra) AddSprite ¶
AddSprite adds a sprite to current scene. To call this function, SetScene must be called in advance.
func (*Simra) AddTouchListener ¶
func (simra *Simra) AddTouchListener(listener peer.TouchListener)
AddTouchListener registers a listener for notifying touch event. Event is notified when "screen" is touched.
func (*Simra) RemoveSprite ¶
RemoveSprite removes specified sprite from current scene. Removed sprite will be disappeared.
func (*Simra) RemoveTouchListener ¶
func (simra *Simra) RemoveTouchListener(listener peer.TouchListener)
RemoveTouchListener unregisters a listener for notifying touch event.
func (*Simra) SetDesiredScreenSize ¶
SetDesiredScreenSize configures virtual screen size. This function must be called at least once before calling Start.
type Sprite ¶
Sprite represents a sprite object.
func (*Sprite) AddTouchListener ¶
func (sprite *Sprite) AddTouchListener(listener peer.TouchListener)
AddTouchListener registers a listener for touch event. Touch event will be notified when "sprite" is touched.
func (*Sprite) RemoveAllTouchListener ¶
func (sprite *Sprite) RemoveAllTouchListener()
RemoveAllTouchListener removes all listeners already registered.