i recently discovered there is a limit to the dimensions of a layer and that it's also somewhat unpredictable.
so i thought that i would split all the objects off into different layers instead.
so then i would have one layer per object
i figure there's no point in drawing the things that aren't on screen at the time, so i thought up of some solutions...
i was wondering if anyone could comment on the efficiency of the following approaches or suggest an efficient approach. the layers that have to change will be really light graphics... nothing too intense... i suppose think fireworks... if i'm drawing 10,000 unique fireworks on screen, not all of them need to be on screen at the same time but they all have to be drawn at some point
the goal is to have the layers appearing on screen at some point with as little lag as possible with the possibility of hardware intense things happening on other processes..
approach one:
hide the layers that aren't on screen by using the hide method.
i found this method in the documentation, i says it can hide the layer, so i figure maybe it doesn't draw the layer at all until it's un-hidden. so it will save on graphics memory?
with this approach i would add all 10,000 layers to a root layer that is drawn on screen. so this might be quite intensive on the RAM because it has to keep an instance of 10,000 layers plus all sorts of other instance variables that are specific to each layer
approach two:
to avoid using too much of the graphics memory and RAM i thought maybe i could just keep a list of some sort that only had an instance of the layers that are on screen.
when something needs to be drawn, the layer is created and the layer is then added to that list, and some other layer might be removed from the list so it's no longer drawn.
could this be too processor intensive? creating layers and adding them to an array list on the fly?
any suggestions would be appreciated.
so i thought that i would split all the objects off into different layers instead.
so then i would have one layer per object
i figure there's no point in drawing the things that aren't on screen at the time, so i thought up of some solutions...
i was wondering if anyone could comment on the efficiency of the following approaches or suggest an efficient approach. the layers that have to change will be really light graphics... nothing too intense... i suppose think fireworks... if i'm drawing 10,000 unique fireworks on screen, not all of them need to be on screen at the same time but they all have to be drawn at some point
the goal is to have the layers appearing on screen at some point with as little lag as possible with the possibility of hardware intense things happening on other processes..
approach one:
hide the layers that aren't on screen by using the hide method.
i found this method in the documentation, i says it can hide the layer, so i figure maybe it doesn't draw the layer at all until it's un-hidden. so it will save on graphics memory?
with this approach i would add all 10,000 layers to a root layer that is drawn on screen. so this might be quite intensive on the RAM because it has to keep an instance of 10,000 layers plus all sorts of other instance variables that are specific to each layer
approach two:
to avoid using too much of the graphics memory and RAM i thought maybe i could just keep a list of some sort that only had an instance of the layers that are on screen.
when something needs to be drawn, the layer is created and the layer is then added to that list, and some other layer might be removed from the list so it's no longer drawn.
could this be too processor intensive? creating layers and adding them to an array list on the fly?
any suggestions would be appreciated.