Log In  
Follow
ggiboihmis
[ :: Read More :: ]

I'm working on a project where I want to relegate some of the simpler sprites to being generated by the code, rather than occupying valuable space in the sprite sheet and map areas. However, it just dawned on me that I am running many loops of line(), rect(), etc. every single _draw() call, which I have a gut feeling isn't a very efficient way of doing things. Aside from the obvious "just use the sprite sheet" solution, is there a way in which I can continue to generate images from code BUT only run this one time (eg. during _init()), and then load the buffered images during _draw() somehow?

Even if the answer is just simply that this isn't possible, knowing so would at least put my mind at rest!


EDIT: Misremembered my implementation somewhat!
-"single _update() call" => "single _draw() call";
-"to use this image generation code BUT only call it one time" => "to generate images from code BUT only run this one time".

P#75890 2020-05-05 21:34 ( Edited 2020-05-05 22:45)