This site requires JavaScript, please enable it in your browser!
Greenfoot back
jhadad
jhadad wrote ...

2015/1/6

Multi Touch

jhadad jhadad

2015/1/6

#
Hi, I was wondering if I could program multiple touch points or mouse events with greenfoot for windows 8. From what I can tell there is a library called javaFX that should allow for multi touch but I can't figure out how to use it. Thanks John
danpost danpost

2015/1/6

#
Maybe if you explain what you are actually trying to do, we could come up with a suitable solution for you. I, for one, am not quite sure what you mean by 'multiple touch points'; however, when you add 'or mouse events', it appears you want to use two or more different points of mouse action to accomplish some single task.
jhadad jhadad

2015/1/6

#
Hi thanks for the quick reply, I am trying to make a game for a windows 8 touch screen monitor where when you put down 2 fingers on the screen it makes a line between the 2 touch points. Thanks John
danpost danpost

2015/1/6

#
jhadad wrote...
I am trying to make a game for a windows 8 touch screen monitor where when you put down 2 fingers on the screen it makes a line between the 2 touch points.
Ergo, the reference to the javaFX library. I am understanding your dilemma; unfortunately, I cannot help in this matter as this is something I am totally unfamiliar with. I will look into the library to see what I can understand from it.
jhadad jhadad

2015/1/6

#
OK thanks anyways, I was hoping coding games for a touchscreen would be simple because its all based on mouse events but it looks like its gonna be a little complicated just getting to that point. John
danpost danpost

2015/1/6

#
Well, it is not really based on mouse events; although, it is based on events which will require the same sort of coding -- using event handlers and event objects (in your case, these being TouchEvent objects, which contain TouchPoint objects which each have a TouchPoint.State).
jhadad jhadad

2015/1/6

#
OK, so do you know how I go about playing around with these TouchEvents in the first place? Would all of that be part of javaFX? Thanks, John
danpost danpost

2015/1/6

#
Well, TouchEvent and TouchPoint are part of the javaFX library; however, all classes, regardless of library, have the Object class as their root. The EventListener class is part of the java.util library. As far as playing around with them, you will have to experiment on your own. You could look at what classes are used and how they are used with respect to the mouse and try to set it up similarly for your case.
You need to login to post a reply.