Hi, I need to create a dart board, with four sections in each number (1-20 in standard dart board numbering), is this possible graphically?
Brilliant thanks, now I need to work out how to use it in straight B4A not B4XPages, thanks againAttached the xDartboardDemo project and the xDartboard.b4xlib.
It is a B4XPages project and the dart board is a b4xlib library.
Clicking on the dart board raises an event returning the ring index and sector.
View attachment 167227
There is nothing special.now I need to work out how to use it in straight B4A not B4XPages, thanks again
Thanks again, I will have a goThere is nothing special.
The xDartboard is a b4xlib CustomView.
Two possiblities:
1. Use the b4xlib, you need to save it in the Additional\B4X folder (the folder for additional b4xlib libraries), and check xDartbord in the Libraries Manager Tab.
2. Load the xDartboard.bas file into the project folder.
Then, in the Designer AddView/CustomView/xDartboard
Hi Klaus, just a quick question, using your code when the dartboard is touch it registers the change but reports it multiple times, is there an option to get the event of one click, I tried changing _change to _click but didn't work, sorry for my lack of understandingHere you are.
Hi Klaus, there seems to be no files attachedAttached the xDartboardDemo project and the xDartboard.b4xlib.
It is a B4XPages project and the dart board is a b4xlib library.
Clicking on the dart board raises an event returning the ring index and sector.
View attachment 167227
Hi Klaus, there seems to be no files attached
Very good, Colin!Many, many thanks to Klaus for the library. Using his expertise, I managed to knock together the Killer Game to add to my Darts ScoreBoard Game, link to the full apk - Full Dart ScoreBoard apk
I've also knocked up a separate app, which I've attached the source code. One thing of note I managed to amend Klaus's class (Hope that is okay Klaus) it's in the source code as class module, basically to accommodate the allocation of the random numbers, and show visually on screen. Everyone starts with a pale blue segment of their number apart from the current player, which is shaded gold. To play the game, a player has to hit their own number three times, which then makes them a Killer, on their next turn they can attack the other players, when given a Killer status their active segment is shaded Dark Orange if the current player and Dark Blue if not active, A killer needs to attack other players, if the attacked are a killer they lose that status when hit, and subsequently lose a life on every hit. If you're a darts player I'm sure it will make sense![]()
For i = 0 To 19
'Adjust for dartboard orientation - the SectorNumber array starts at top (20)
'but drawing starts 5 positions earlier, so we need to offset
Dim adjustedIndex As Int = (i + 5) Mod 20
Angle = i * 18 - 9