'Scrabble Board Tiles in Android
i'm very new to android and i don't know much about the attributes that android uses.for my scrabble game board, i decided that i'll use an image of an actual game board. i was thinking that i'll use a gridview for the board tiles.
i just wanna ask if it's possible to split the image into a 15 x 15 board that i can use? like i can put a specific code for each triple word, double letter, etc. values each tile contain?
thanks for the help in advance!
Solution 1:[1]
You can try setting the image as a background of the parent layout (the wrapper of the gridview). Then add the GridView as a child with a Translucent theme. Something like:
gridview.setAlpha(alpha)
This way you won't have to crop the image into pieces.
Haven't tried it. It's just a suggestion!
Solution 2:[2]
Maybe you can create 15 * 15 = 225 tiles (you won't have to manually create it of course, just copy paste) and then give each tile a name in matrix format like the first tile as a00, second (in first line) as a01 etc. and then when working on their cell values, create a variable initiated as 'a' and add the matrix number of the tile you want to go to (like a + '0' + '1') and use this variable as the id of the tile you want to work on.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | kirilv |
| Solution 2 | NewCoder1423 |
