CPU : CloneObject VS CopyPaste

Discussion and feedback on Construct 2

Post » Mon Sep 12, 2016 2:51 pm

Hello

I would like to create many buttons using "sprite font" with a unique font. It would be more handy if i can create new object each time so i can name every object.
But I wonder if this would be more CPU intensive than just copy / paste. Somebody got information about that ?

Thanks
Image
B
9
S
1
Posts: 22
Reputation: 581

Post » Mon Sep 12, 2016 3:26 pm

It would not be more cpu intensive.
It would use more memory than just using instances.
Keep in mind all instances share the same texture.
Image ImageImage
B
168
S
50
G
163
Posts: 8,224
Reputation: 105,067

Post » Mon Sep 12, 2016 4:11 pm

And the needed code will multiply out of control.

Just give them a instance variable ... text .. 'name' .. and name them in the layout editor. (without " "'s)

Then just use

Sprite font > Compare Instance Variable > 'name' = whatever you named it between " ".
Now that sprite font is picked, and actions run on that sprite font.
B
33
S
18
G
27
Posts: 2,447
Reputation: 20,358

Post » Mon Sep 12, 2016 5:29 pm

depends on how many buttons is "many" if its a large amount of anything(>500) it can get pretty cpu intensive or hard(RAM/HDD - reading and writting) usage going upper! however it wont make a difference for today's PC's. I cant say about mobile apps, depends what is your target as a device there, but if you plan a universal app for as many mobile platforms as possible... you wold need to keep things S&S and just create the illusion of many buttons! i always use sprites object as buttons, i know needs more download memory and ram ... but once its loaded any device can use it without much effort!
B
70
S
20
G
67
Posts: 1,315
Reputation: 42,303

Post » Mon Sep 12, 2016 8:29 pm

Ok so I finally used instances

Thank you
Image
B
9
S
1
Posts: 22
Reputation: 581


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 10 guests