Hello all again,
Today I came here with a small issue, it’s about drawing into Codea.
I need to draw some elements once, not every frame.
For a better understand I’ll show you a sample code:
-- Lines function setup() displayMode(FULLSCREEN) strokeWidth(2) stroke(0, 0, 0, 255) for i = 0 , 60 do line(i*20, HEIGHT, i*20, 0) line(0, i*20, WIDTH, i*20) end end function draw() background(255, 255, 255, 255) end ``` I need to draw these lines one time. If these lines are drawn in draw(), it will affect the performance.
I tried a trick. But, the screen blinks continuously. Here's the code:-- Lines function setup() displayMode(FULLSCREEN) background(255, 255, 255, 255) strokeWidth(2) stroke(0, 0, 0, 255) for i = 0 , 60 do line(i*20, HEIGHT, i*20, 0) line(0, i*20, WIDTH, i*20) end end function draw() --background(255, 255, 255, 255) end ``` The solution? Possibility to drawing in setup() or Adding a new function called drawOnce().
Maybe I can already do this in Codea, but maybe I don't know how.
So, Please help me to solve this problem.