iPhone Touch demo and howto compile

Previous topic - Next topic

Billamu

Thanks for that Backslider. When I get a moment to have another go at it I'll try that out.  I suspect that it's throwing errors because it says that there are 16 different mouses (touches) available, which may be true for an iPad, but not for an iPhone. I'll see what happens...
I'm an Aries. I have lots of Ram.

Billamu

Yeah it was MouseCount seeing 16 touches and the array is only 5.
I cobbled this together and it runs fine now.

Code (glbasic) Select
FUNCTION updateMice:
    gm = GETMOUSECOUNT()-1
    IF gm>4 THEN gm=4
    FOR imouse% = 0 TO gm
        SETACTIVEMOUSE imouse%
        MOUSESTATE mx%, my%, b1%, b2%
        mouse[imouse].x=mx
        mouse[imouse].y=my
        mouse[imouse].active=b1
    NEXT
ENDFUNCTION
I'm an Aries. I have lots of Ram.

matchy

A tip is to reverse the loop so that the active mouse exits the function on the default 0 state.  :P

Here's my mouse update function:  ;)
http://www.glbasic.com/forum/index.php?topic=4806.msg36640#msg36640

backslider

@Billamu: I had exactly the same error at first on iPhone :D

I solved the problem like this example:

Code (glbasic) Select

type Mouse
x
y
endtype

global mouse[] as Mouse
dim mouse[getmousecount()]


...and it works.

tft

Hallo,

this example is not work with XCode 4 and Lion. I have made 100 ciclus and tested ....... on the display from the IPohne i cand see anymore.

Sorry my english its so little bit.

Thx TFT

johnparker29

The only factor I haven't been able to do is determine when the direction of the iPhone has modified i.e. scenery to symbol etc.  Well I did perform out a technique but it was flaky at best.  I've explored the iPhone SDK and Im still not sure how they do it.