Cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Linking text with different font sizes

ANSWERED

Hey guys i'm really new to all of this, but i'm trying to make a digital clockface. I want the hours, minutes, seconds and ampm to shift together when the hour changes form double to single digit. But my seconds and ampm labels are a different font size from the hour and minutes. How do I code it so I can keep the different font sizes and still have everything shift together?

Currently I have it set up as:

hoursLabel.text = `${hours}:${mins}`;
secondsLabel.text = `${sec} ${ampm}`;

Best Answer
0 Votes
1 BEST ANSWER

Accepted Solutions

This is tricky but possible. Have a look at getBBox().

If you're not careful, you can get a situation in which elements move around slightly every second. Maybe that doesn't matter, but I don't think it's a good look.

Peter McLennan
Gondwana Software

View best answer in original post

Best Answer
0 Votes
2 REPLIES 2

This is tricky but possible. Have a look at getBBox().

If you're not careful, you can get a situation in which elements move around slightly every second. Maybe that doesn't matter, but I don't think it's a good look.

Peter McLennan
Gondwana Software
Best Answer
0 Votes

Thank you, I have never worked with getBBox() before, but i'll take some time to figure out how it works.

Best Answer
0 Votes