It looks like you're new here. If you want to get involved, click one of these buttons!
This code:
function CreateGraphic:formula()
--[[
Function is called like this in 'draw':
local img = self:formula()
sprite(img, (WIDTH+225)/2, HEIGHT/2+50, 700, 450)
]]
img = image(450, 300)
setContext(img)
fill(127, 127, 127, 255)
rect(0, 0, 450, 300)
setContext()
return img
end
It's definitely this function, because when commenting it, it won't crash Codea.
Comments
The function looks like it calls itself, so it goes round and round until it crashes
What do you mean by "calls itself"?
I am not calling the function anywhere else...
Instead of making another function, I have put the code part in 'draw', and it was still crashing:
Still crashes
Why are you using setContext every time you draw?
Okey, Fixed, creating new images 60 times a miliseconds is crashing Codea.
Just made it being elements...
Hi,
Try putting your image generation in setup then just sprite the image in draw:
Make sure the size of your img is the same size as the rectangle.
Bri_G
But it should be updated automatically...