Jump to content
  • Advertisement
Sign in to follow this  
dsage

Center text above an image

This topic is 4656 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

I remeber doing somthing like this in a VB class I took a few years ago. We had to center a window on during its startup. I can't remeber what the what the formula was for it. I'm trying to center text above my sprites for debug information. I can get the image position and width and the string's width(in pixels) and position. Makes me wish I payed more attention in class back then... even if it _was_ a VB class. =P Note: This game is in c++ for those who care.

Share this post


Link to post
Share on other sites
Advertisement
It's amazing what a little pad of paper and some thinking can do.
x2 = x1+(w1/2) - (w2/2)



Note: I didn't make the background or fish. So i'm not claiming them. Just test images.

[Edited by - dsage on September 23, 2005 10:12:35 AM]

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!