https://kotlinlang.org logo
Title
s

Sam Michael

08/03/2021, 8:28 AM
Trying to make a go game board. Wonder if anyone here attempted this in compose? I seem to be stuck with the idea of manually drawing the board lines (using canvas API) and then overlaying circular buttons on top. It seems like chess would be easier because each button could represent a board square, whereas in go we play stones on the corner. Anyway, anyone interested or have any suggestions?
When I made console version I used unicode characters with different box vertices shapes ╀, ┌, ┟. So that kind of approach might work too, trying to find the most Compose idiomatic way to get started
d

Dominaezzz

08/03/2021, 3:11 PM
You can do the chess idea but use a cross as the background.
s

Sam Michael

08/03/2021, 3:47 PM
Thanks, making progress maybe, ended up using unicode box characters to form the board for now, but still need to figure out how to superimpose a circle on these buttons when pressed and in general make everything line up better:
d

Dominaezzz

08/03/2021, 6:11 PM
There's a drawBehind modifier that gives you a canvas.
s

Sam Michael

08/04/2021, 12:39 PM
Thanks, is there a drawFront modifier, having trouble getting the circle perfectly in front of the vertices