Increase hit region of an object
2 posters
Increase hit region of an object
Hi,
I Is it possible to increase the hit region from a specific object?
In my 3d world exist some small objects and it is very difficult to touch/select (sio2ResourceSelect3D) these objects with the touch screen from the iPhone.
How can I do this? Or is it necessary to change the coordinates and invoke the sio2ResourceSelect3D method again?
Thanks a lot
ludi
I Is it possible to increase the hit region from a specific object?
In my 3d world exist some small objects and it is very difficult to touch/select (sio2ResourceSelect3D) these objects with the touch screen from the iPhone.
How can I do this? Or is it necessary to change the coordinates and invoke the sio2ResourceSelect3D method again?
Thanks a lot
ludi
ludi- Posts : 14
Join date : 2008-10-19
Re: Increase hit region of an object
Are your objects moving?
If they are *not* moving, you can always define a square region in the screen tap callback, like this:
void templateScreenTap( void *_ptr, unsigned char _state )
{
unsigned int tap = sio2->_SIO2window->n_tap;
unsigned int my_x = sio2->_SIO2window->touch[ 0 ]->x;
unsigned int my_y = sio2->_SIO2window->touch[ 0 ]->y;
if( _state == SIO2_WINDOW_TAP_DOWN && level == 1){
//if we clicked a button in the lower left area
if((tap == 1) && (my_x > 10) && (my_x < 100) && (my_y > 10) && (my_y < 100)){
doWhatever();
}
}
If they are *not* moving, you can always define a square region in the screen tap callback, like this:
void templateScreenTap( void *_ptr, unsigned char _state )
{
unsigned int tap = sio2->_SIO2window->n_tap;
unsigned int my_x = sio2->_SIO2window->touch[ 0 ]->x;
unsigned int my_y = sio2->_SIO2window->touch[ 0 ]->y;
if( _state == SIO2_WINDOW_TAP_DOWN && level == 1){
//if we clicked a button in the lower left area
if((tap == 1) && (my_x > 10) && (my_x < 100) && (my_y > 10) && (my_y < 100)){
doWhatever();
}
}
meteors- Posts : 241
Join date : 2008-11-08
Location : Sunny Florida
Re: Increase hit region of an object
My object does not move, but it is possible that the camera is moving.
So this is not the right solution for me.
Any further ideas?
So this is not the right solution for me.
Any further ideas?
ludi- Posts : 14
Join date : 2008-10-19
Re: Increase hit region of an object
You could create a larger invisible object around each object, and use it for the selection...
-j
-j
meteors- Posts : 241
Join date : 2008-11-08
Location : Sunny Florida
Re: Increase hit region of an object
Hi,
i think that's a good idea! I will try it.
Thanks
i think that's a good idea! I will try it.
Thanks
ludi- Posts : 14
Join date : 2008-10-19
Re: Increase hit region of an object
anytime :-)
-j
-j
meteors- Posts : 241
Join date : 2008-11-08
Location : Sunny Florida
Similar topics
» How to draw pictures of some of the region?
» physics object inside another physics object
» how can move other object near
» Render 3D Object in GUI
» Object with two materials
» physics object inside another physics object
» how can move other object near
» Render 3D Object in GUI
» Object with two materials
Permissions in this forum:
You cannot reply to topics in this forum