Spritefont numbers, or text object?

Discussion and feedback on Construct 2

Post » Sun Feb 02, 2014 4:54 pm

Hi everyone,

I was trying to optimize my game a bit.
I have 4 text objects which are set to display global values:
Every tick
set GemsTXT to Gems
set BallsLeft to Balls
set ScoreTXT to Score
set LvlTXT to lvl


My question is, would it be better to use spritefont with numbers instead of the text object? what would be the best for optimization?



Best regards!

xanxion2014-02-02 16:55:00
B
37
S
9
G
8
Posts: 541
Reputation: 8,554

Post » Sun Feb 02, 2014 6:13 pm

Spritefont for performance every time.

C2 is a Canvas game renderer. TextObjects are HTML DOM objects. This creates 2 distinct different non render layers within C2 rendering. This will hurt performance.

However desktop computers can handle the performance loss to the point that no one will ever notice, but if at anytime you have plans to do a mobile port you should be using SpriteFont.
B
90
S
18
G
9
Posts: 2,455
Reputation: 15,028

Post » Sun Feb 02, 2014 9:51 pm

thanks alot for the information. I'll go for spritefonts!
B
37
S
9
G
8
Posts: 541
Reputation: 8,554


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 14 guests