c++ - A method of creating simple game GUI -
I am able to get a lot of information on the real logic development for the game. I would really like to create a card game, but how can I not just understand the position of the mouse, an object can be selected (or at least in the right way) before I thought of Boxing Boxing , But all my bitmaps are not rectangular. I then thought that f hides a hidden buffer with a different color of each object, but it seems that it has to do this way. I am wondering how this is actually done. For example, how do Adobe Flash know the object under the mouse?
Thank you
Your question is how to tell that the mouse is non- Above the rectangular bitmap. I'm assuming that all your bitmaps are really rectangular, but they have transparent areas. Depending on the scheme you use, you should first be able to tell the transparent part of your (rectangular) bitmap in any way (for example if you consider color to be transparent or if you use a little mask ) You will also know the bitmap's z-order (layering) on your canvas. Then when you find a click on position (X, Y), you need to find a list of rectangular bitmaps on that pixel. Sort them by z-order and check for each if the pixel is transparent or not. If so, go to the next bitmap if not, then this is the selected bitmap
Comments
Post a Comment