Sign in to follow this  
ivandotnet

Highlighting objects

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
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this