smart-fun / smartGL

SmartGL is a Graphic Engine for creating Android Games and Apps. It is based on OpenGL and handles 2D Sprites and 3D Textured Objects.
Apache License 2.0
109 stars 24 forks source link

onTouchEvent #13

Open schwarzen13 opened 6 years ago

schwarzen13 commented 6 years ago

Hello, I'm currently trying to apply touch event to my 3d Object. How can I use onTouchEvent? thank you very much.

smart-fun commented 6 years ago

Hello,

at the moment the touch events are only 2D screen positions. This is planned to convert 2D <-> 3D position, but I can't tell you when it will be available.

See also https://github.com/smart-fun/smartGL/issues/10

dhemas commented 6 years ago

Hi @smart-fun , Im trying to apply simple touch event. How can I achieve this? Im doing like this:

@Override public void onTouchEvent(SmartGLView smartGLView, TouchHelperEvent event) { Log.d("TAG", "TOUCHED!"); }

but no touch logged.

smart-fun commented 6 years ago

Hello dhemdhem,

simply set the clickable attribute of your SmartGLView to true.

android:clickable="true"

I should add this in the documentation...

Arnaud