If you’re using a rectangle on screen, is there any reason to choose a generated display.newRect over a .png image file? Will the .newRect take up less memory or are they functionally the same?
I’m guessing you would want the newRect object, generally speaking, because there is no image asset to load into memory (giving you xxx kb of image data vs. <x kb of code.) Imagine the image as one big, uncompressable table of pixels whereas the newRect is a math equation and a (very small) memory footprint. Any computational cost of the newRect is easily handled by even a feeble GPU.
Even if they somehow required the same amount of storage I would still recommend newRect when possible simply because it saves you from adding one more object to asset management.
I’m guessing you would want the newRect object, generally speaking, because there is no image asset to load into memory (giving you xxx kb of image data vs. <x kb of code.) Imagine the image as one big, uncompressable table of pixels whereas the newRect is a math equation and a (very small) memory footprint. Any computational cost of the newRect is easily handled by even a feeble GPU.
Even if they somehow required the same amount of storage I would still recommend newRect when possible simply because it saves you from adding one more object to asset management.