Raycaster example works
This commit is contained in:
@@ -103,7 +103,7 @@ func (game *Game) tick () {
|
||||
if game.stamina < 0 {
|
||||
game.stamina = 0
|
||||
}
|
||||
|
||||
|
||||
tomo.Do(game.Invalidate)
|
||||
if statUpdate && game.onStatUpdate != nil {
|
||||
tomo.Do(game.onStatUpdate)
|
||||
|
||||
@@ -57,12 +57,13 @@ func run () {
|
||||
topBar.Adopt(elements.NewLabel("Health:"))
|
||||
topBar.AdoptExpand(healthBar)
|
||||
container.Adopt(topBar)
|
||||
container.AdoptExpand(game)
|
||||
container.AdoptExpand(game.Raycaster)
|
||||
game.Focus()
|
||||
|
||||
game.OnStatUpdate (func () {
|
||||
staminaBar.SetProgress(game.Stamina())
|
||||
})
|
||||
game.Start()
|
||||
|
||||
window.OnClose(tomo.Stop)
|
||||
window.Show()
|
||||
|
||||
@@ -138,6 +138,8 @@ func (element *Raycaster) Focus () {
|
||||
element.entity.Focus()
|
||||
}
|
||||
|
||||
func (element *Raycaster) SetEnabled (bool) { }
|
||||
|
||||
func (element *Raycaster) Enabled () bool { return true }
|
||||
|
||||
func (element *Raycaster) HandleFocusChange () { }
|
||||
|
||||
Reference in New Issue
Block a user