Main forum > GLBasic - en

iPhone Touch demo and howto compile

<< < (7/8) > >>

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...

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) ---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
--- End code ---

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) ---type Mouse
 x
 y
endtype

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

--- End code ---

...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

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version