Archived

This topic is now archived and is closed to further replies.

Is there an easy way to center text in Ortho?

This topic is 5010 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Like, to have text centered exactly. Like this:
            New Game
         Continue Game
            Credits
              Quit

not like this:
          New Game
          Continue Game
          Credits
          Quit

that just won''t cut it

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
<pedantry>
Correct, although

pos_x = (screen_width - text_width) * 0.5

could well run faster - replacement of two divisions by a multiplication, though this will depend on how good at optimising your compiler is!

I''m pretty sure it''s also slightly (not that you could see it!) more accurate.
</pedantry>

Share this post


Link to post
Share on other sites
depends what kind of fonts you''re using... If it''s bitmap fonts (i bet it is) your font code will have it somewhere. In fact no matter how it''s done, your font lib will know about it. UTSL.

Share this post


Link to post
Share on other sites