05-31-2020 13:39
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

05-31-2020 13:39
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
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}`;
Answered! Go to the Best Answer.

Accepted Solutions
05-31-2020 14:20
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post


05-31-2020 14:20
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
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.
Gondwana Software

05-31-2020 14:20
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post


05-31-2020 14:20
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
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.
Gondwana Software

05-31-2020 15:40
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

05-31-2020 15:40
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
Thank you, I have never worked with getBBox() before, but i'll take some time to figure out how it works.

