Jump to content
  • Advertisement
Sign in to follow this  
ivandotnet

Highlighting objects

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

Heya, got a little problem here, I hope someone can help me out with it. :) What I want to achieve is a mouse over effect over 2D or 3D objects in the scene. Just like how you would see some buttons and objects highlight in Games when you mouseover them. The way I'm doing it, is to have 2 separate images, one original and one highlighted. I will load the highlighted image once the mouse is over that particular region that I want. This works fine, but it is WAY too time consuming having to create 2 images for every object that I want to highlight. It seems a bit redundant too, since the highlight is all the same, just a glowing line or border around the image. Any better suggestion to tackle this problem?

Share this post


Link to post
Share on other sites
Advertisement
What kind of objects are you hovering? It sounds like sprites?

You could use colorizing to highlight them, like turn them blue or green. Or you could draw your normal images slightly darker than they were created and draw hovered images normally. There are also a lot of blending operations you could use to add light to something, but they will burn out detail as well.

With 3D objects, you could just turn up ambience if you use lighting. Or you could do the same colorizing effect there as well.

edit: Oops, I re-read your post, and it sounds like you just mean drawing a border around the object? Do the lines have to be glowing/blurred? If nothing else, you could create 4 corner bracket sprites and draw them on the outside corners of each hovered object. This way, there is no size restriction.

Share this post


Link to post
Share on other sites
Yes, bracket sprites should do it for a regular image. But what if the image itself is not regular. Say for example I use a picture of a rock, with a transparent background. So it is not a rectangular / squarish image. And I would like to highlight that image.

The effect that I want to achieve is something like the images found in Heroes 3. When you go to the Town screen, and mouse over the buildings, they automatically highlight around the non-transparent border of the images.

They may be using two separate images to highlight, I don't know. But it would be cool if there is some automated way to just draw a border around the solid edges of an image.

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!