Sprite Font + and Score

Get help using Construct 2

Post » Sat Nov 30, 2013 9:06 am

Hi,

First time I'm trying to use Sprite Font and I read the tutorial and manual (the manual is specific, but I would love to see an example).

I'm trying to set up a Score counter with a Sprite Font. I found a score example from 2011 in the (FAQ) How do I....

However, with all the updates in C2, I was wondering if there is an easy way to setup a score system with the Sprite Font+ Plugin. I was able to setup the correct PNG with the correct space, but I have not been able to understand how to use it dynamically to update the score every tick or every 0.1 second.

Also, why do I need to rewrite all the font, one by one if I'm using JSON and I already provided the width, and the order of the alphabet to use?

Thanks!
B
8
S
3
G
1
Posts: 135
Reputation: 2,209

Post » Sat Nov 30, 2013 9:15 am

system every tick - spritefont set text: "score: "&SCORE

in which SCORE is the name of the global variable holding the score.

I'm not sure about the second question, but you probably are setting the letter width, so not all letters have the same width. an I has less width than a W. On the spritesheet for the spritefont all letters have the same width.
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Sat Nov 30, 2013 9:31 am

@LittleStain thank you so much!!! It does work without having to follow the long set of steps I read in another forum. Thanks, this is so much simpler... I do feel dumb because I noticed is the same way than the one using TEXT (set text to "Socre " & Score) just replacing it for SpriteFont.
B
8
S
3
G
1
Posts: 135
Reputation: 2,209


Return to How do I....?

Who is online

Users browsing this forum: Kin, mickclarke, newt, TRMG and 49 guests