Search Home Members Contacts
About Us
Products
Downloads
Community
Support
Pages: [1]
  Print  
Author Topic: DrawText in Visual Basic 2008  (Read 991 times)
Aled Owen
Community Member
*
Posts: 11


« on: May 26, 2009, 12:52:22 PM »

I want to make some text appear on screen what tells me the value of a variable, at the moment I have this:

Code:
Scene.DrawText(sngWalk, 300, 100, red)

Everything is fine but the "red" bit, which is supposed to be defined as an integer, what should I put in place there to make the text colour red (assuming that the field is for that).

Thanks.
Logged
Aled Owen
Community Member
*
Posts: 11


« Reply #1 on: May 26, 2009, 02:26:49 PM »

Nevermind I'll use Screen2DText.
Logged
micmanos
Customers
Community Member
*****
Posts: 512


« Reply #2 on: June 01, 2009, 01:52:13 AM »

Usually it's a Hex format number ...

&hAARRGGBB or in some cases &hRRGGBB ... where ..

AA = 00 to FF - controls the opacity.
RR = 00 to FF - controls the Red.
GG = 00 to FF - controls the Green.
BB = 00 to FF - controls the Blue.

For solid red use .. &hFFFF0000
Logged

What i lack in knowledge, i make up for in stupidity so i have a better excuse than the rest ...
SylvainTV
Administrator
Community Member
*****
Posts: 4944


WWW
« Reply #3 on: June 01, 2009, 08:18:54 AM »

You can also use the RGBA or RGBA256 helper function which returns a integer from 4 R G B A values. In Visual Basic 2008 I believe you have to create an instance of the TVGlobals class and use the RGBA/RGBA256 function from there.

Don't forget to set alpha to 1.0 or 255, else you won't see anything on screen.
Logged

Regards

Sylvain Dupont
TrueVision3D Developer
sylvain@truevision3d.com

TV3D IRC at http://chat.truevision3d.com or on server irc.truevision3d.com #Truevision3D. Come talk with us !
uncasid
Community Member
*
Posts: 109


« Reply #4 on: June 01, 2009, 09:00:21 AM »

System.Drawing.Color.Red.ToArgb()

This will convert to the hex format.
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by SMF 1.1.3 | SMF © 2006-2007, Simple Machines LLC
Seo4Smf v0.2 © Webmaster's Talks