Results 1 to 3 of 3
Thread: Help Getting Image Coordinates
- 09-06-2010, 07:58 AM #1
Member
- Join Date
- Sep 2010
- Posts
- 5
- Rep Power
- 0
Help Getting Image Coordinates
Ok, attempt 2 here..
I need to get the coordinates to draw an image from a string to draw a map with tiles.
the stringWidth and height are both 16Java Code:private int[][] data = new int[WIDTH][HEIGHT];
and the input is likecurrently I'm usingJava Code:data[8][2] = BLOCKED;
and thenJava Code:public int getTile(int x, int y) { return data[x][y]; }but that returns an error.Java Code:g.drawImage(Tile, getTile(x, y),x*16,y*16, null);
(the *16 is because the squares are 16*16)
- 09-06-2010, 08:29 AM #2
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,379
- Blog Entries
- 7
- Rep Power
- 17
-
Witik, please don't start a second thread without responding to the first one. This unnecessarily fragments your discussion. For this reason, I'm going to lock one, please tell me which.
Similar Threads
-
Coordinates
By Witik in forum New To JavaReplies: 3Last Post: 09-06-2010, 07:05 AM -
Help with printing out new coordinates
By tyke in forum New To JavaReplies: 1Last Post: 05-10-2010, 06:34 AM -
Help with plotting x-y coordinates
By Fidelcashflow in forum New To JavaReplies: 3Last Post: 12-02-2009, 11:17 AM -
Getting mouse coordinates
By nishant.4545 in forum Advanced JavaReplies: 3Last Post: 07-20-2009, 11:28 PM -
button coordinates
By jacline in forum AWT / SwingReplies: 2Last Post: 04-05-2009, 10:58 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks