Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Android
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Tim Cooke
Campbell Ritchie
Ron McLeod
Junilu Lacar
Liutauras Vilda
Sheriffs:
Paul Clapham
Jeanne Boyarsky
Henry Wong
Saloon Keepers:
Tim Moores
Tim Holloway
Stephan van Hulst
Piet Souris
Carey Brown
Bartenders:
Jesse Duncan
Frits Walraven
Mikalai Zaikin
Forum:
Android
Graphics 2D Problem
Jason Gosling
Greenhorn
Posts: 5
posted 12 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
I am trying to do a Gomuko Game on Android. Here is a part from my code to draw the board to play game. I don't know why it's wrong
For each point of board. I use an array (int board[13][13]) to contain it. May be it's wrong in android
protected void onDraw(Canvas canvas){ Paint paint = new Paint(); paint.setColor(Color.GRAY); int width = 300, height = 300; for (int i = 1; i < 13; i++){ canvas.drawLine(1 + 13*i, 0, 1 + 13*i, height, paint); canvas.drawLine(0, 1 + 13*i, width, 1 + 13*i, paint); } paint.setColor(Color.BLACK); canvas.drawRect(0,0,width-1,height-1, paint); canvas.drawRect(1,1,width-3,height-3, paint); for (int row = 0; row < 13; row++) for (int col = 0; col < 13; col++) if (board[row][col] != EMPTY) drawPiece(canvas, board[row][col], row, col); if (win_r1 >= 0) drawWinLine(canvas); }
Here is my full code:
http://www.mediafire.com/download.php?25gfjdtdnzm
Please check for me if you have time
Thanks in advance
I have always wanted to have a neighbor just like you - Fred Rogers. Tiny ad:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
The x,y coordinates are not working
After two days, I still can't see the obvious.
Drawing Problems with JPanel /Jframe need optimize solution.
Couple of Problems
Someone, everyone, PLEASE HELP ME ON A PROJECT!!
More...