Please if anyone knows how to get the touches to trigger fast please post how you did it.
@pac Please stop creating a new discussion for every question you ask. Pick one of your existing discussions or this one, and ask all your questions there.
As for your question, you can’t increase the speed of the touch or draw routine. They run at 60 times per second except I think on the newer iPads where they might run at 120 times per second. Even though you can’t increase the speed, the speed can be reduced as your programs get more complex. For complex programs where the speed is reduced on one type of iPad, they might run at normal speed (60) on devices with faster processors.
Sorry about the new discussion thing I will do that from now one.
Thanks for the touch info so I don’t keep looking for something that’s not there.
So do you know if when you publish it does the touch respond faster?
Because if not I will need to redo me code.
And thank you again and again Dave.
@pac I’ve never published anything so I can’t say from experience. As I said above, the draw and touch routines run at 60 times per second so they probably do the same for published code. You’ll have to wait for someone who published code to give an exact answer.
PS. What are you trying to do that you need faster touch. No one can touch the screen faster than 60 times per second.
My code just does not (never has) responded very fast even if it is in a program all on it’s on I won’t respond faster than about 1 touch per second. And I have an iPad Pro.
So if you could post how the touch should be done
Thank you again pac
This will add 1 to the number as fast as you can touch the screen.
function setup() fill(255) a=0 end function draw() background(40, 40, 50) text(a,WIDTH/2,HEIGHT/2) end function touched(t) if t.state==BEGAN then a=a+1 end end
This will add 1 to the number as fast as you can move your finger across the screen.
function setup() fill(255) a=0 end function draw() background(40, 40, 50) text(a,WIDTH/2,HEIGHT/2) end function touched(t) if t.state==MOVING then a=a+1 end end
Okay thanks again I was not doing it the right way at all
So thanks again.
Okay so I have run into a problem we’re I am trying to put down terrain but the problem is that I was using sprites but the problem is that it slows the program down to much to keep redrawing the sprites so does anyone know how to put something on the screen that won’t disappear?
Please write if you do Pac
@pac Try using a mesh. Look it up in the reference and we’ll go from there.
I think I found how do to it with an image making it so that it only has to draw one sprite but could some one please post some code on how to do images
I okay I will check that out thanks
Can you put more than one sprite into a mesh?
Just a quick question I need to ask before I go to far
So I think I know the answer of the can they hold more than one sprite which is yes.
But I don’t know who to work with pictures please post code
Here’s a lot of sprites and it still runs at full speed.
displayMode(FULLSCREEN) function setup() tot,cnt=0,0 rectMode(CENTER) size=20 m=mesh() for x=1,WIDTH/size do for y=1,HEIGHT/size do m:addRect(x*size,y*size,size,size*2) end end m.texture="Planet Cute:Character Cat Girl" end function draw() background(40, 40, 50) m:draw() fill(255) rect(WIDTH/2,HEIGHT-50,70,30) fill(0) cnt=cnt+1 tot=tot+DeltaTime text("fps "..cnt//tot,WIDTH/2,HEIGHT-50) end
Okay I see your use of mesh I think this will work.
But with me track recorded I will be back on in about a minute