Jump to content
  • Advertisement
Sign in to follow this  
iscream3

Visual Basic If,Then question

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

Is it possible to make a variable with a specific color? For example can u make a If,Then statement like this. If "Color" = Blue Then set "Click" = true "Color" and "Click" are variables. Is it possible to do this and is there a tool to get the color?

Share this post


Link to post
Share on other sites
Advertisement
I'm not exactly sure how this works in Visual Basic, but I imagine that you use some kind of hexadecimal notation for colors.

Example:

Red = 0xffff0000
Blue = 0xff0000ff
Green = 0xff00ff00
Black = 0xff000000
White = 0xffffffff

In this way, a four-byte value such as an int can store colors.

Share this post


Link to post
Share on other sites
It's been over a year since I last used VB.NET, so this is from memory. You probably want something like this:
Dim myColour as Color
Dim wasClicked as Boolean
If myColor = Color.Blue Then
wasClicked = True
End If


Syntax and whatnot might not be right.

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.

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!