示例#1
0
func pressButton(b *staticimg.StaticImg, u *uistate.UIState) {
	if !b.GetHidden() {
		u.Eng.SetSubTex(b.GetNode(), b.GetAlt())
		b.SetHidden(false)
		b.SetDisplayingImage(false)
	}
}
示例#2
0
func AlternateImgs(s *staticimg.StaticImg, u *uistate.UIState) {
	<-time.After(100 * time.Millisecond)
	node := s.GetNode()
	node.Arranger = arrangerFunc(func(eng sprite.Engine, node *sprite.Node, t clock.Time) {
		t0 := uint32(t) % 10
		if t0 < 5 {
			u.Eng.SetSubTex(s.GetNode(), s.GetImage())
		} else {
			u.Eng.SetSubTex(s.GetNode(), s.GetAlt())
		}
	})
}