Welcome Guest. Please Login or Register. Apr 5th, 2018, 9:55pm
ATTENTION MEMBERS: Conforums will be closing it doors and discontinuing its service on April 15, 2018. Ad-Free has been deactivated. Outstanding Ad-Free credits will be reimbursed to respective payment methods.
If you require a dump of the post on your message board, please come to the support board and request it.
Sprite detection
« Thread started on: Aug 7th, 2017, 11:40am »
I have 16 sprites each of a different colour and non-rectangular shape. I can detect the location of each by checking x & y coordinates but this does not distinguish between visible and transparent regions of the sprite. I want to be able to detect the sprite by clicking on the visible part. Detection must not occur (as it does with x & y coords) if I click on the transparent part. I have noticed that POINT(x,y) and TINT(x,y) both return the colour underneath the sprite, not the colour of the sprite. How can I do this?
You may consider using *DISPLAY if you choose to allow BBC to see the color. There is also *SCREENSAVE (But then you would have to keep doing captures and overlays. which would be inefficient)
I'm sure there are many techniques, like my introduced way of detection called Echo Detection. If you look at buttonz in the RETROLIB 10 in TOOLS, you can see how this can work. Echo the known colors of your sprite when the mouse enters the work area and make the sprite react depending on the mouse conditions.
The correct active color will always be active using this method and it can be done efficiently.
I don't quite see why you would want to detect the sprite color though, as it should be known once you enter its borders and can be defined in an echo style programming technique.