• Advertisement

Archived

This topic is now archived and is closed to further replies.

Highlight speed question

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

I would like to implent an highlighting feature in my engine. Like when your mouse is over an object in Baldur''s Gate, the contour of the object becomes highlighted. I figured two way of doing this: - First one, change my bitmap of the object to include a single pixel line, which is very close to the key color of the blit, around it. When I would blit the object, I would spread the the key color to include or not the highlight line. - Second one, do it all with a draw line function. Which seems to me pretty slow and hard to implent. So which one is the faster ? And fell free to tell me your ideas on this and give other ways of doing it.

Share this post


Link to post
Share on other sites
Advertisement
Assuming your sprites have proper masks, you can extract the mask and do edge detection on it. This will give you the outline of the figure. You may need to enlarge and crop it to get it to be around your figure properly. From there you can either use this as a mask for whatever highlighting you want to do or just transform it into a highlight image.

Share this post


Link to post
Share on other sites

  • Advertisement