ironic
Topic Author
Posts: 17
Joined: 20 Nov 2013, 16:40

Canvas elements recreation performance.

12 Dec 2013, 15:50

Hi!

I am planning to use NoesisGui for an application which includes 2d shapes editing. For it I will probably use Canvas and put elements on it. Now it is important for me to know whether there would be a big overhead if I recreate all Children of canvas on every update. Speaking numbers, I expect to have a Canvas with no more than 1000 elements (mostly texts and paths with solid and possibly some gradient colors).

So three questions are:
Is Canvas suitable for such task?
Is there a chance that recreating all children will be performing quickly enough on tablets?
If not, then would it help if I only update shapes that actually change?

Thanks!
 
User avatar
sfernandez
Site Admin
Posts: 1912
Joined: 22 Dec 2011, 19:20

Re: Canvas elements recreation performance.

13 Dec 2013, 10:59

Is Canvas suitable for such task?
Canvas is only the container of elements. It determines the position of its children using their Canvas.Left/Right and Canvas.Top/Bottom properties. Children size does not depend on Canvas size, so you have to set the dimensions of the children manually.
Is there a chance that recreating all children will be performing quickly enough on tablets?
If not, then would it help if I only update shapes that actually change?
Whenever is possible, you should only modify the properties that need to change, using the same objects and resources. Otherwise, lots of new objects would be created each frame, and you will lose everything that gets cached in the render tree.

Who is online

Users browsing this forum: No registered users and 1 guest