XNA - Displaying Centred Text(virtualrealm.com.au)

submitted by MykreMykre(830) 4 years, 5 months ago

Here is a couple of quick lines of code that will allow you to display some text on the screen that is centred. When using this sample it will calculate the length of the text, then work out the exact centre of the screen. Then using the normal sprite origin functions it will work out the exact centre of the text and position it on the screen.

add a comment |category: |Views: 25

tags: another

new Add a live kick counter to your blog >> liveImage

You can even customize the image by choosing your own colors, and then clicking the button below to update the preview and the html code:

  • "Kick It" text
  • "Kick It" background
  • kick count text
  • kick count background
  • border

Simply copy and paste this HTML into your blog post.


Users who kicked this story:
Comments:

No comments so far

information Login or create an account to comment on this story