Hello,
I'm writing a game that displays 56 hexagon pieces filling the screen in the shape of a board. I'm currently drawing each piece using a singleton rendering class that when called to draw a piece, creates a path from 6 points based of the coordinate passed in. This path is filled with a solid color and then a 59x59 png with an alpha to white gradient is overlayed over the drawing to give the piece a shiny look. Note i'm currently doing this in core graphics.
My first thought is that creating a path everytime i draw is costly and seems like i can somehow do this once and then reuse it, but i'm not sure of the best approach for this. When i look at the bottlenecks with shark, it looks like the drawing of the png is the most taxing part of the process. I've tried just rendering the png overlay or just rendering the path w/o the overlay and both give me some frame gains, altho removing the png overlay yields the most frames.
My current thought is that at startup, i should render 6 paths(1 for each color piece i have) and overlay them with the png and then store an image of these pieces and then just redraw the pieces each time i need them. Is there an effecient machanism for storing something you've drawn once and redrawing it? It kinda just sounds like i'd be running into the whole drawing pngs too often thing again, but maybe there's a less taxing method that does a similar thing...
Any suggestions are much appreciated. Thanks!