ok lads, I finally made some progress, this is a very early version, and I still need to do alot of improvements, but I’m still welcoming feedback and critisism
and yes i know the square’s colors aren’t how they should be… but I can’t seem to get the colors right, or I should add some extra triangles to that mesh…?
@stevon8ter I like it. The only thing I have a problem with is when I’m moving the small circle into the corner of the square, I hit the outside area which then moves the larger circle to that area. Maybe the square should be a little smaller so there’s more room between it and the outer area.
@dave1707 yeah I should probably do that, but I also gotta add that once you press the square for example, and then move outside, you still have the ‘cursor’ thingy there selected untill the touch is ended, like the native codea color choser, so you can drag it around etc, also another thing I gotta do is make it so that the hexagon thing can only be moved in the center, if you get what i mean, … like that the circle thing’s always in the center of it, that will also remove another bug at the same time (try doing it to the corner of the blue, sometimes the color then changes to black…
@Jmv38 Does it run at 60fps all the time? On mine then it drops to about 30fps when new touch data comes in (due to the image:get - when I comment out that line then it runs at 60fps all the time).
Hmm i added an fps watcher, and it slows the code to 30fps, and that’s on an ipad 3, does anyone know how this could be? Are it the calculations for the triangle, or are there to much meshes (I don’t think so, alot of apps use more meshes, i only use 14 triangles for every color chooser…)
@stevon8ter is this while touching the colour picker? If so it’s because of a constant use of img:get(x,y) every frame, you could make it so this is called every other frame, I’m not sure if it will make much of a different to the performance…
To make it get called every other frame make a new variable called Switch and set it to ‘true’.
Then in your draw function type Switch = not Switch
then use this if statement
if Switch then
colours = img:get(x,y)
end
I don’t the above is great practice but it might help… Also you don’t want to be drawing to the screen every frame using img:get(x,y). You should store this as a colour variable when touching the screen, you can check this by setting a variable to true in the colour picker touched function then when the touch ends set it to false, then use that variable in the draw function around img:get(x,y) that should improve the speed a lot.
@Luatee, I had already changed the draw event so it doesn’t use the getcolor, I’ve put it in the touch function, tho it’s around 30 fps even when not touching, touching doesn’t really lower the fps…
@Luatee, ok nevermind, I forgot to change something in my code, but I fixed it, now it runs at 60fps, tho when touching it drops to 35, but I think that wouldn’t be that much of a problem since there shouldn’t be to much to do when choosing a color
Edit: i figured out how to increase the fps when touching but that will be something for tommorow, going to bed now
just wanna know that because I need feedback for inprovement and troubleshooting, also, which ipad are you on and how much fps does it give you? (iirc you’re on ipad1 so yeah I wanna know how it runs there as well )
@Luatee@SkyTheCoder I think @Jmv38 knows that already but it somehow froze… idk what the problem would be though, for now I haven’t had a freeze when using my code