Jump to content
  • Advertisement


  • Content count

  • Joined

  • Last visited

Community Reputation

140 Neutral

About Monza

  • Rank
  1. I'm sure the 'measurestring' returned rectangle is the size of the string if it was rendered to the screen without scaling or transformation.  It appears to be based on the size and number of lines of the rendered font.  Which would be fine if I was sending it to the screen without transformation.   But the sprite is set to 'objectspace' which transforms and renders it into the scene at a completely different size.  This is the size I need (so I can calculate how to draw a bounding box around the text).   Maybe I can 'project' the font sprite bounding box coordinates into the scene to work out the size?
  2. Trying to get the rendered bounding rectangle from a font sprite set to render into objectspace (not screen space) coordinates.   But the d3d9Font.measurestring(sprite .......    only gives the non objectspace rectangle even through the sprite is defined to render in objectspace.   So basically, even though the font is rendered into the 3D scene correctly at the correct depth and perspective based size (eg the same sized font may range from a few to 500 pixels of more depending on depth), I cannot get this size rectangle, because the measurestring only returns a fixed size (eg 250 x 100) regardless of rendered depth as if it was rendered directly to screen with objectspace not set (ie in transformed coordinates)   Do I need to use the defined sprite transformation matrix in another calculation or am I missing something?   Is there another way to compute the final text rendered screen size?  
  • Advertisement

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!