vialab / SMT

Simple Multi-Touch (SMT) Toolkit
http://vialab.science.uoit.ca/smt
GNU General Public License v3.0
43 stars 18 forks source link

touchUpImpl & touchDownImpl do not work in a extended class zone #191

Closed Kimaker closed 10 years ago

Kimaker commented 10 years ago

Hello everybody!

I am a french user of your library, I congrate and thank you for that amazing work. I permit to write you to describe a problem that I have. I use a "class extends zone" in my work, it is a sort of a class ball where all balls are zones. I used touchImpl() and drawImpl() in this class, what that work well, but not touchUpImpl() and touchDownImpl(). I was wondering if it was normal? Thank you in advance

kiwistrongis commented 10 years ago

Thanks :).

The mistake that you're probably making is that touchUpImpl() and touchDownImpl() have a Touch parameter. They should be defined like this:

  @Override
  public void touchUpImpl( Touch touch){}
  @Override
  public void touchDownImpl( Touch touch){}
Kimaker commented 10 years ago

Than you very much, it works! I have a last question, it is possible to have a getTouchFromeZone() in a touchImpl()?

kiwistrongis commented 10 years ago

I'm not really sure I understand your question. Maybe the function you're looking for is Zone.getTouches()? It returns all the touches that are currently assigned to the zone. You can use it like this:

  @Override
  public void touchImpl(){
    Touch[] touches = this.getTouches();
  }
Kimaker commented 10 years ago

Yes! It was exactly what I was looking for. Again thank you very much, and keep going just like that it is very useful :)

kiwistrongis commented 10 years ago

You're welcome :). I'll mark this issue as closed then.