BASIC

Author Topic: iPhone Touch demo and howto compile  (Read 18150 times)

Offline Billamu

  • Mc. Print
  • *
  • Posts: 27
    • View Profile
    • Yuckbear.com
Re: iPhone Touch demo and howto compile
« Reply #30 on: 2010-Sep-10 »
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.

Offline Billamu

  • Mc. Print
  • *
  • Posts: 27
    • View Profile
    • Yuckbear.com
Re: iPhone Touch demo and howto compile
« Reply #31 on: 2010-Sep-10 »
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.

Offline matchy

  • Prof. Inline
  • *****
  • Posts: 1538
    • View Profile
Re: iPhone Touch demo and howto compile
« Reply #32 on: 2010-Sep-10 »
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

Offline backslider

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 892
    • View Profile
Re: iPhone Touch demo and howto compile
« Reply #33 on: 2010-Sep-10 »
@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.

Offline tft

  • Mr. Polyvector
  • ***
  • Posts: 132
    • View Profile
Re: iPhone Touch demo and howto compile
« Reply #34 on: 2011-Aug-29 »
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

  • Guest
Re: iPhone Touch demo and howto compile
« Reply #35 on: 2012-Sep-29 »
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.