conifer icon indicating copy to clipboard operation
conifer copied to clipboard

Area reacting to events

Open nbrr opened this issue 3 years ago • 1 comments

How can we proceed if we want a non-trivial area to react to an event? I'm thinking about something like a directional pad: you want a different direction to be triggered depending on where you tap it. We could keep in memory those items with a map similar to that used for blitting, e.g. the d-pad event zone would be described by 4 bmaps:

00100 00000 00000 00000
00100 00000 00000 00000
00000 00000 11000 00011
00000 00100 00000 00000
00000 00100 00000 00000

For example when there is a tap one could determine if it falls on the relevant area (add top-left coordinates to the bmaps) and check if it is expected to react.

nbrr avatar Sep 01 '20 21:09 nbrr