// OnTouchMove is called when Title scene is Touched and moved.
// It is caused by calling AddtouchListener for title.background sprite.
966380
func (t *Title) OnTouchMove(x, y float32) {
	t.spawnKokeshi(x, y)
}
424243
func (m *Meta) touch(ptr interface{}) {
	if m.touched == nil {
		m.touched = make(map[interface{}]struct{}, 1)
	}
	m.touched[ptr] = struct{}{}
}
1058306
func touch(state *messages.InstanceCache, instanceID string, now time.Time) {
	entry := state.Entries[instanceID]
	if entry == nil {
		entry = &messages.InstanceCache_Entry{}
		if state.Entries == nil {
			state.Entries = map[string]*messages.InstanceCache_Entry{}
		}
		state.Entries[instanceID] = entry
	}
	entry.LastAccess = google.NewTimestamp(now)
}
976604
func ButtonRight(p *input.DispatchMouseEventParams) *input.DispatchMouseEventParams {
	return p.WithButton(input.ButtonRight)
}
359473
func (c *ButtonRedTouchListener) OnTouchBegin(x, y float32) {
	if c.buttonReplaced {
		c.originalButtonColor()
	} else {
		c.replaceButtonColor()
	}
	c.simra.AddSprite(c.ball)
	tex := c.simra.NewImageTexture("ball.png",
		image.Rect(0, 0, c.ball.GetScale().W, c.ball.GetScale().H))
	c.ball.ReplaceTexture(tex)
}
1091016
func (t *Tab) MoveMouse(x, y float64) error {
	mouseMovedParams := &gcdapi.InputDispatchMouseEventParams{TheType: "mouseMoved",
		X: x,
		Y: y,
	}

	_, err := t.Input.DispatchMouseEventWithParams(mouseMovedParams)
	return err
}
802384
func (s *UpdateEnvironmentInput) SetOptionsToRemove(v []*OptionSpecification) *UpdateEnvironmentInput {
	s.OptionsToRemove = v
	return s
}
182242
func touchPath(filename string) (string, error) {
	if path.IsAbs(filename) {
		if _, err := os.Stat(filename); err == nil {
			// path exists, overwrite
			return filename, nil
		}
	}

	d, f := path.Split(filename)
	dir, err := filepath.Abs(filepath.Dir(os.Args[0]))
	if err != nil {
		return "", err
	}

	_, err = os.Stat(path.Join(dir, filename))
	if err == nil {
		// path exists, overwrite
		return filename, nil
	}

	dirPath := path.Join(dir, d)
	filePath := path.Join(dirPath, f)
	if d != "" {
		err = os.MkdirAll(dirPath, os.ModeDir)
		if err != nil {
			return "", err
		}
	}

	return filePath, nil
}
1246355
func (s *sample) OnTouchEnd(x, y float32) {
	s.isTouching = false

	if s.gamestate == readyToStart {
		s.gamestate = started
		s.removeReadyText()
	} else if s.gamestate == readyToRestart {
		// TODO: methodize
		s.resetPosition()
		s.views.restart()
		s.models.restart()

		tex := s.simra.NewImageTexture("heart.png", image.Rect(0, 0, 384, 384))

		for i := 0; i < 3; i++ {
			s.simra.AddSprite(s.life[i].Spriter)
			s.life[i].ReplaceTexture(tex)
		}

		s.simra.RemoveSprite(s.gameovertext[0])
		s.simra.RemoveSprite(s.gameovertext[1])

		s.remainingLife = remainingLifeAtStart

		s.showReadyText()
		s.gamestate = readyToStart
	}
}
920411
func (t *Title) OnTouchEnd(x, y float32) {
	if t.isAnimating {
		t.effect.StopAnimation()
		t.isAnimating = false
	} else {
		shouldLoop := true
		t.effect.StartAnimation("animation test", shouldLoop, func() {
			t.effect.ReplaceTexture(t.initialSprite)
		})
		t.isAnimating = true
	}
}
1249284
func KeyPress(listener func(*vecty.Event)) *vecty.EventListener {
	return &vecty.EventListener{Name: "keypress", Listener: listener}
}
776466
func DeviceOrientation(listener func(*vecty.Event)) *vecty.EventListener {
	return &vecty.EventListener{Name: "deviceorientation", Listener: listener}
}
986699
func (m *Meta) WasTouched(field string) bool {
	m.detectTouchedFlags()
	ptr, ok := m.fieldsMap()[field]
	if !ok {
		panic(fmt.Sprintf("no such meta field %s", field))
	}
	_, yes := m.touched[ptr]
	return yes
}
47385
func MouseMove(listener func(*vecty.Event)) *vecty.EventListener {
	return &vecty.EventListener{Name: "mousemove", Listener: listener}
}
630501
func (t *Title) OnTouchEnd(x, y float32) {
	// scene end. go to next scene
	t.simra.SetScene(&sample{})
}
1312632
func TouchStart(listener func(*vecty.Event)) *vecty.EventListener {
	return &vecty.EventListener{Name: "touchstart", Listener: listener}
}
551253
func (ss *Rate) Touch(key string, nowTs time.Time) {
	now := nowTs.UnixNano()

	var bucket *bucket
	if bucketno, found := ss.keytobucketno[key]; found {
		bucket = &ss.buckets[bucketno]
	} else {
		bucketno = uint32(ss.sh.h[0])

		bucket = &ss.buckets[bucketno]
		delete(ss.keytobucketno, bucket.key)
		ss.keytobucketno[key] = bucketno

		bucket.key, bucket.errLastTs, bucket.errRate =
			key, bucket.lastTs, bucket.rate
	}

	if bucket.lastTs != 0 {
		bucket.rate = ss.count(bucket.rate, bucket.lastTs, now)
	}
	bucket.lastTs = now

	// Even lastTs change may change ordering.
	heap.Fix(&ss.sh, int(bucket.idx))
}