Bennu Game Development

English Forums => Helpdesk => Mensaje iniciado por: Jongf7 en Diciembre 21, 2009, 02:17:10 pm

Título: Touchscreen input
Publicado por: Jongf7 en Diciembre 21, 2009, 02:17:10 pm
There is a full hd touch screen that I can use, and I would like to make a simple game to make people familiar with using it.
The 'game' so far works perfectly with a normal mouse, but when using the touch screen the mouse pointer doesn't follow my finger.
It seems to 'stick' to the edges of the screen and even there doesn't follow my finger.
In windows the screen works fine.

Any one that has a clue as to how a touch screen differs from a mouse and if there is a workaround for this?
Título: Re: Touchscreen input
Publicado por: Windgate en Diciembre 21, 2009, 08:03:04 pm
I think it is not possible to change the position of the mouse on the way it is done on a touch screen... I can't help you, but maybe Splinter... :(
Título: Re: Touchscreen input
Publicado por: Drumpi en Diciembre 22, 2009, 02:26:51 am
Thats is because touchscreen is not a mouse. It act like a mouse, but uses different drivers and can do something different.
I have a wacom tablet (a touch tablet with a pencil) an i tried to use it as a mouse, but if I put the pen in, the cursor don't point, it act like a analog joystick: if i put the pen in the center, muse dont move, if i touch a little bit up, the mouse moves slowly up, if i touch far up, cursor moves up faster... until i stop touch.

Maybe it works similar, maybe it works good, or maybe it don't works, so you need to write your own module in this case. Just ask to SDL.
Título: Re: Touchscreen input
Publicado por: SplinterGU en Diciembre 22, 2009, 02:02:11 pm
BennuGD (SDL) only support touchscreen mouse's compatible.

maybe you need create a new bennugd handler (module) for manage it.
Título: Re: Touchscreen input
Publicado por: Jongf7 en Diciembre 23, 2009, 08:18:14 am
I'm going to try what happens when I control the screen as a joystick, if that doesn't work I will have to put this project on hold as I cannot program DLL files :)
I only know DIV/Fenix/Bennu.

But I'm glad I tried to create something for the screen as it led me to this community, you guys are all very helpful, so I'm really eager to start programming again now :) I even have some ideas for the contest already. Not to win, but just for the fun :)
Título: Re: Touchscreen input
Publicado por: josebita en Diciembre 24, 2009, 01:32:34 am
If you have ideas for the contest... hurry up! there's not much time left :)
Título: Re: Touchscreen input
Publicado por: Jongf7 en Diciembre 25, 2009, 07:08:07 am
I already started working :)
I will email SplinterGU to get a place to post a worklog and some screenshots soon.

I try to make a race game with a rare graphical style.
Título: Re: Touchscreen input
Publicado por: quasist en Diciembre 31, 2009, 08:48:31 pm
Is bennu on GP2X WIZ is also is unable to read touchscreen? If it can then please post some code :)
Título: Re: Touchscreen input
Publicado por: josebita en Enero 01, 2010, 04:21:19 pm
Bennu in the Wiz can also read the touchscreen, yes.

For what I know, to detect the touchscreen input, you just have to wait for mouse.left and then get the mouse.x & mouse.y vars to read the place where the user clicked.
This would be something like:
[code language="bennu"]
Process touchscreen_test()
Private
    int was_clicked=0;

Begin
    LOOP
        // It's usual to detect clicks when the user releases the mouse button, not when they click it
        if( (was_clicked==1) && (! mouse.left))
            say("Touchscreen event @ x:"+mouse.x+" y:"+mouse.y);
        end;

        was_clicked = mouse.left;
        FRAME
    End;
End;
[/code]