Android Question Dart board

Colin Evans

Active Member
Licensed User
Longtime User
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?
 

klaus

Expert
Licensed User
Longtime User
now I need to work out how to use it in straight B4A not B4XPages, thanks again
There 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
 
Upvote 0

Colin Evans

Active Member
Licensed User
Longtime User
There 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
Thanks again, I will have a go😂but if you have two minutes to knock a B4A version together it would be greatly appreciated
 
Upvote 0

Colin Evans

Active Member
Licensed User
Longtime User
Here you are.
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 understanding
 
Upvote 0

emexes

Expert
Licensed User
Longtime User
Hi Klaus, there seems to be no files attached

Lol the downside of operating at Klaus Speed - trying to keep up.

Use the updated .bas (class) file from post #28.

Start a new B4XPages project (I'm using B4J, but should work in B4A and B4I too).

Project menu, add existing modules, select the download xDartboard.bas, copy to project folder

Designer menu, open internal designer

Add view, customview, xDartboard

Drag to desired position and size (ideally squarish, ie same width and height)

Close (and save) designer

F5 to compile & run

Voila!

1758779174369.png


(ok, I left out one step to tidy up the visual positioning of the numbers - clue: change line 41 from 0.9 to 0.87, but you might prefer something different again)
 
Upvote 0

klaus

Expert
Licensed User
Longtime User
Last edited:
Upvote 0
Top