How to make fonts stick to middle of board?

chongyunxiang

  • Posts: 216
Hi,

I created a counter to count the number of hits and managed to display it by drawing out the counter to be shown on a board.

Problem is that the number doesn't stick to the middle of the board, especially when the number of digits increase from 1 to 2, etc.

How do I make my numbers always appear in the middle of the board?

Thanks!

colburt187

  • *
  • Posts: 2402
There is a get width of text block, You could then set the x of text to the x-center of the board -(width of text/2)

chongyunxiang

  • Posts: 216
I understand what you mean, but I can't find the "Get Width" with the X-axis component.

Is this the one?

mdotedot

  • Posts: 1569
Numbers & Text
Fonts
[get width for [ xxxx ] using [ Font ]

Search the forum for extension : center text
Hanging out in the Chat:  http://www.stencyl.com/chat/

Proud member of the League of Idiotic Stencylers! Doing things in Stencyl that probably shouldn't be done.

chongyunxiang

  • Posts: 216
I just downloaded the extension, but I didn't see any Text Align block. Only drawing of shapes.

mdotedot

  • Posts: 1569
First try the default block in Stencyl from the Numbers & Text block.
Hanging out in the Chat:  http://www.stencyl.com/chat/

Proud member of the League of Idiotic Stencylers! Doing things in Stencyl that probably shouldn't be done.