getting the position from the png image of LUDO game
up vote
0
down vote
favorite
hy
i am working on a game in android i.e LUDO Game.
i used four different array of getting the positions of the LUDO Board on Hit and trail mwthod.
Four different arrays are as follow.
int t_LM = { 60, -44, 17, -46, 155, -44, 17, -46, -201, -44, 17, -46,
155, -44, 17, -46 };
int t_TM = { 42, 63, 63, 85, 42, 63, 63, 85, 233, 254, 254, 275, 233,
254, 254, 275 };
int t_o_LM = { 38, -57, -57, -57, -57, -57, 3, -27, -27, -27, -27, -27,
3, -27, -27, -27, -27, -27, 3, 3, 3, 3, 3, 3, -27, -57, -207, 3, 3,
3, 3, 3, -57, -27, -27, -27, -27, -27, -57, -27, -27, -27, -27,
-27, -57, -57, -57, -57, -57, -57, -27, 3 };
int t_o_TM = { 200, 275, 275, 275, 275, 275, 305, 337, 369, 401, 432,
464, 464, 464, 432, 401, 369, 337, 305, 275, 275, 275, 275, 275,
275, 242, 209, 209, 209, 209, 209, 209, 177, 146, 115, 83, 51, 20,
20, 20, 51, 83, 115, 146, 177, 209, 209, 209, 209, 209, 209, 242 };
The image of the LUDO board are as follow
but when i get the coordinates and maps on the Screen of the emulator it shows like this..
The box with pink,yellow and green shown in the pictures are the coordinates i got after Hit and trail method.
any software or link that help to fix this problem are highly appreciated.
Thanks in advance
android android-layout android-intent android-emulator
add a comment |
up vote
0
down vote
favorite
hy
i am working on a game in android i.e LUDO Game.
i used four different array of getting the positions of the LUDO Board on Hit and trail mwthod.
Four different arrays are as follow.
int t_LM = { 60, -44, 17, -46, 155, -44, 17, -46, -201, -44, 17, -46,
155, -44, 17, -46 };
int t_TM = { 42, 63, 63, 85, 42, 63, 63, 85, 233, 254, 254, 275, 233,
254, 254, 275 };
int t_o_LM = { 38, -57, -57, -57, -57, -57, 3, -27, -27, -27, -27, -27,
3, -27, -27, -27, -27, -27, 3, 3, 3, 3, 3, 3, -27, -57, -207, 3, 3,
3, 3, 3, -57, -27, -27, -27, -27, -27, -57, -27, -27, -27, -27,
-27, -57, -57, -57, -57, -57, -57, -27, 3 };
int t_o_TM = { 200, 275, 275, 275, 275, 275, 305, 337, 369, 401, 432,
464, 464, 464, 432, 401, 369, 337, 305, 275, 275, 275, 275, 275,
275, 242, 209, 209, 209, 209, 209, 209, 177, 146, 115, 83, 51, 20,
20, 20, 51, 83, 115, 146, 177, 209, 209, 209, 209, 209, 209, 242 };
The image of the LUDO board are as follow
but when i get the coordinates and maps on the Screen of the emulator it shows like this..
The box with pink,yellow and green shown in the pictures are the coordinates i got after Hit and trail method.
any software or link that help to fix this problem are highly appreciated.
Thanks in advance
android android-layout android-intent android-emulator
It is, at least for me, totally impossible to understand your problem...
– WarrenFaith
Nov 26 '12 at 19:55
2
You need to take care of each mobile screen density.
– AZ_
Nov 27 '12 at 5:37
Formula for Rectangular shape. Local picture coordinates to mobile phone coordinates Where pVertices[0] = px; pVertices[1] = py; public void transformLocalToScene(final float pVertices) { int count = pVertices.length / 2; int i = 0; int j = 0; while(--count >= 0) { final float x = pVertices[i++]; final float y = pVertices[i++]; pVertices[j++] = x * this.a + y * this.c + this.tx; pVertices[j++] = x * this.b + y * this.d + this.ty; } }
– AZ_
Nov 27 '12 at 5:47
hi.i am facing problem in ludo game development.i am not able to move tokens as per dice roll.like if dice displays 2 then token will move two position forward.can you give me idea about it.thanks for reply
– user1639837
May 22 '13 at 20:27
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
hy
i am working on a game in android i.e LUDO Game.
i used four different array of getting the positions of the LUDO Board on Hit and trail mwthod.
Four different arrays are as follow.
int t_LM = { 60, -44, 17, -46, 155, -44, 17, -46, -201, -44, 17, -46,
155, -44, 17, -46 };
int t_TM = { 42, 63, 63, 85, 42, 63, 63, 85, 233, 254, 254, 275, 233,
254, 254, 275 };
int t_o_LM = { 38, -57, -57, -57, -57, -57, 3, -27, -27, -27, -27, -27,
3, -27, -27, -27, -27, -27, 3, 3, 3, 3, 3, 3, -27, -57, -207, 3, 3,
3, 3, 3, -57, -27, -27, -27, -27, -27, -57, -27, -27, -27, -27,
-27, -57, -57, -57, -57, -57, -57, -27, 3 };
int t_o_TM = { 200, 275, 275, 275, 275, 275, 305, 337, 369, 401, 432,
464, 464, 464, 432, 401, 369, 337, 305, 275, 275, 275, 275, 275,
275, 242, 209, 209, 209, 209, 209, 209, 177, 146, 115, 83, 51, 20,
20, 20, 51, 83, 115, 146, 177, 209, 209, 209, 209, 209, 209, 242 };
The image of the LUDO board are as follow
but when i get the coordinates and maps on the Screen of the emulator it shows like this..
The box with pink,yellow and green shown in the pictures are the coordinates i got after Hit and trail method.
any software or link that help to fix this problem are highly appreciated.
Thanks in advance
android android-layout android-intent android-emulator
hy
i am working on a game in android i.e LUDO Game.
i used four different array of getting the positions of the LUDO Board on Hit and trail mwthod.
Four different arrays are as follow.
int t_LM = { 60, -44, 17, -46, 155, -44, 17, -46, -201, -44, 17, -46,
155, -44, 17, -46 };
int t_TM = { 42, 63, 63, 85, 42, 63, 63, 85, 233, 254, 254, 275, 233,
254, 254, 275 };
int t_o_LM = { 38, -57, -57, -57, -57, -57, 3, -27, -27, -27, -27, -27,
3, -27, -27, -27, -27, -27, 3, 3, 3, 3, 3, 3, -27, -57, -207, 3, 3,
3, 3, 3, -57, -27, -27, -27, -27, -27, -57, -27, -27, -27, -27,
-27, -57, -57, -57, -57, -57, -57, -27, 3 };
int t_o_TM = { 200, 275, 275, 275, 275, 275, 305, 337, 369, 401, 432,
464, 464, 464, 432, 401, 369, 337, 305, 275, 275, 275, 275, 275,
275, 242, 209, 209, 209, 209, 209, 209, 177, 146, 115, 83, 51, 20,
20, 20, 51, 83, 115, 146, 177, 209, 209, 209, 209, 209, 209, 242 };
The image of the LUDO board are as follow
but when i get the coordinates and maps on the Screen of the emulator it shows like this..
The box with pink,yellow and green shown in the pictures are the coordinates i got after Hit and trail method.
any software or link that help to fix this problem are highly appreciated.
Thanks in advance
android android-layout android-intent android-emulator
android android-layout android-intent android-emulator
asked Nov 26 '12 at 19:51
fahad Idrees
98211
98211
It is, at least for me, totally impossible to understand your problem...
– WarrenFaith
Nov 26 '12 at 19:55
2
You need to take care of each mobile screen density.
– AZ_
Nov 27 '12 at 5:37
Formula for Rectangular shape. Local picture coordinates to mobile phone coordinates Where pVertices[0] = px; pVertices[1] = py; public void transformLocalToScene(final float pVertices) { int count = pVertices.length / 2; int i = 0; int j = 0; while(--count >= 0) { final float x = pVertices[i++]; final float y = pVertices[i++]; pVertices[j++] = x * this.a + y * this.c + this.tx; pVertices[j++] = x * this.b + y * this.d + this.ty; } }
– AZ_
Nov 27 '12 at 5:47
hi.i am facing problem in ludo game development.i am not able to move tokens as per dice roll.like if dice displays 2 then token will move two position forward.can you give me idea about it.thanks for reply
– user1639837
May 22 '13 at 20:27
add a comment |
It is, at least for me, totally impossible to understand your problem...
– WarrenFaith
Nov 26 '12 at 19:55
2
You need to take care of each mobile screen density.
– AZ_
Nov 27 '12 at 5:37
Formula for Rectangular shape. Local picture coordinates to mobile phone coordinates Where pVertices[0] = px; pVertices[1] = py; public void transformLocalToScene(final float pVertices) { int count = pVertices.length / 2; int i = 0; int j = 0; while(--count >= 0) { final float x = pVertices[i++]; final float y = pVertices[i++]; pVertices[j++] = x * this.a + y * this.c + this.tx; pVertices[j++] = x * this.b + y * this.d + this.ty; } }
– AZ_
Nov 27 '12 at 5:47
hi.i am facing problem in ludo game development.i am not able to move tokens as per dice roll.like if dice displays 2 then token will move two position forward.can you give me idea about it.thanks for reply
– user1639837
May 22 '13 at 20:27
It is, at least for me, totally impossible to understand your problem...
– WarrenFaith
Nov 26 '12 at 19:55
It is, at least for me, totally impossible to understand your problem...
– WarrenFaith
Nov 26 '12 at 19:55
2
2
You need to take care of each mobile screen density.
– AZ_
Nov 27 '12 at 5:37
You need to take care of each mobile screen density.
– AZ_
Nov 27 '12 at 5:37
Formula for Rectangular shape. Local picture coordinates to mobile phone coordinates Where pVertices[0] = px; pVertices[1] = py; public void transformLocalToScene(final float pVertices) { int count = pVertices.length / 2; int i = 0; int j = 0; while(--count >= 0) { final float x = pVertices[i++]; final float y = pVertices[i++]; pVertices[j++] = x * this.a + y * this.c + this.tx; pVertices[j++] = x * this.b + y * this.d + this.ty; } }
– AZ_
Nov 27 '12 at 5:47
Formula for Rectangular shape. Local picture coordinates to mobile phone coordinates Where pVertices[0] = px; pVertices[1] = py; public void transformLocalToScene(final float pVertices) { int count = pVertices.length / 2; int i = 0; int j = 0; while(--count >= 0) { final float x = pVertices[i++]; final float y = pVertices[i++]; pVertices[j++] = x * this.a + y * this.c + this.tx; pVertices[j++] = x * this.b + y * this.d + this.ty; } }
– AZ_
Nov 27 '12 at 5:47
hi.i am facing problem in ludo game development.i am not able to move tokens as per dice roll.like if dice displays 2 then token will move two position forward.can you give me idea about it.thanks for reply
– user1639837
May 22 '13 at 20:27
hi.i am facing problem in ludo game development.i am not able to move tokens as per dice roll.like if dice displays 2 then token will move two position forward.can you give me idea about it.thanks for reply
– user1639837
May 22 '13 at 20:27
add a comment |
2 Answers
2
active
oldest
votes
up vote
0
down vote
I assume you want to move the pink, yellow and green tiles
on the top of white squares
which are part of a background image
.
I am not sure if you can get the specific coordinates(belonging to white boxes)
of the image at run time. (Please comment, if it is possible. I would love to learn)
My alternative would be, when you roll a dice
let the user touch the specific white box
and draw the colored tile
over it.
Else, you can draw you own board programmatically
or through xml
and change the color of the white box
to the color of the user tile
i am not sure about setting coordinates at run time but i am doing it statically. i want to set these colored tiles on the white boxes but i need to get the locations of the boxes so that ican set them accordingly. Kindly suggest any idea how can i achieve it
– fahad Idrees
Nov 26 '12 at 20:26
add a comment |
up vote
0
down vote
You can use aspect ratio to resolve this issue. Take the dimensions of the original image by hand, measure some initial positions of pieces from original image, get dimensions of image on run time, calculate aspect ratio of original and onscreen image and place pieces using that ratio at run time.
add a comment |
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
I assume you want to move the pink, yellow and green tiles
on the top of white squares
which are part of a background image
.
I am not sure if you can get the specific coordinates(belonging to white boxes)
of the image at run time. (Please comment, if it is possible. I would love to learn)
My alternative would be, when you roll a dice
let the user touch the specific white box
and draw the colored tile
over it.
Else, you can draw you own board programmatically
or through xml
and change the color of the white box
to the color of the user tile
i am not sure about setting coordinates at run time but i am doing it statically. i want to set these colored tiles on the white boxes but i need to get the locations of the boxes so that ican set them accordingly. Kindly suggest any idea how can i achieve it
– fahad Idrees
Nov 26 '12 at 20:26
add a comment |
up vote
0
down vote
I assume you want to move the pink, yellow and green tiles
on the top of white squares
which are part of a background image
.
I am not sure if you can get the specific coordinates(belonging to white boxes)
of the image at run time. (Please comment, if it is possible. I would love to learn)
My alternative would be, when you roll a dice
let the user touch the specific white box
and draw the colored tile
over it.
Else, you can draw you own board programmatically
or through xml
and change the color of the white box
to the color of the user tile
i am not sure about setting coordinates at run time but i am doing it statically. i want to set these colored tiles on the white boxes but i need to get the locations of the boxes so that ican set them accordingly. Kindly suggest any idea how can i achieve it
– fahad Idrees
Nov 26 '12 at 20:26
add a comment |
up vote
0
down vote
up vote
0
down vote
I assume you want to move the pink, yellow and green tiles
on the top of white squares
which are part of a background image
.
I am not sure if you can get the specific coordinates(belonging to white boxes)
of the image at run time. (Please comment, if it is possible. I would love to learn)
My alternative would be, when you roll a dice
let the user touch the specific white box
and draw the colored tile
over it.
Else, you can draw you own board programmatically
or through xml
and change the color of the white box
to the color of the user tile
I assume you want to move the pink, yellow and green tiles
on the top of white squares
which are part of a background image
.
I am not sure if you can get the specific coordinates(belonging to white boxes)
of the image at run time. (Please comment, if it is possible. I would love to learn)
My alternative would be, when you roll a dice
let the user touch the specific white box
and draw the colored tile
over it.
Else, you can draw you own board programmatically
or through xml
and change the color of the white box
to the color of the user tile
answered Nov 26 '12 at 20:12
Robin Chander
5,75932035
5,75932035
i am not sure about setting coordinates at run time but i am doing it statically. i want to set these colored tiles on the white boxes but i need to get the locations of the boxes so that ican set them accordingly. Kindly suggest any idea how can i achieve it
– fahad Idrees
Nov 26 '12 at 20:26
add a comment |
i am not sure about setting coordinates at run time but i am doing it statically. i want to set these colored tiles on the white boxes but i need to get the locations of the boxes so that ican set them accordingly. Kindly suggest any idea how can i achieve it
– fahad Idrees
Nov 26 '12 at 20:26
i am not sure about setting coordinates at run time but i am doing it statically. i want to set these colored tiles on the white boxes but i need to get the locations of the boxes so that ican set them accordingly. Kindly suggest any idea how can i achieve it
– fahad Idrees
Nov 26 '12 at 20:26
i am not sure about setting coordinates at run time but i am doing it statically. i want to set these colored tiles on the white boxes but i need to get the locations of the boxes so that ican set them accordingly. Kindly suggest any idea how can i achieve it
– fahad Idrees
Nov 26 '12 at 20:26
add a comment |
up vote
0
down vote
You can use aspect ratio to resolve this issue. Take the dimensions of the original image by hand, measure some initial positions of pieces from original image, get dimensions of image on run time, calculate aspect ratio of original and onscreen image and place pieces using that ratio at run time.
add a comment |
up vote
0
down vote
You can use aspect ratio to resolve this issue. Take the dimensions of the original image by hand, measure some initial positions of pieces from original image, get dimensions of image on run time, calculate aspect ratio of original and onscreen image and place pieces using that ratio at run time.
add a comment |
up vote
0
down vote
up vote
0
down vote
You can use aspect ratio to resolve this issue. Take the dimensions of the original image by hand, measure some initial positions of pieces from original image, get dimensions of image on run time, calculate aspect ratio of original and onscreen image and place pieces using that ratio at run time.
You can use aspect ratio to resolve this issue. Take the dimensions of the original image by hand, measure some initial positions of pieces from original image, get dimensions of image on run time, calculate aspect ratio of original and onscreen image and place pieces using that ratio at run time.
answered Mar 19 '13 at 12:59
Khawar Raza
7,4562258115
7,4562258115
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f13572056%2fgetting-the-position-from-the-png-image-of-ludo-game%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
It is, at least for me, totally impossible to understand your problem...
– WarrenFaith
Nov 26 '12 at 19:55
2
You need to take care of each mobile screen density.
– AZ_
Nov 27 '12 at 5:37
Formula for Rectangular shape. Local picture coordinates to mobile phone coordinates Where pVertices[0] = px; pVertices[1] = py; public void transformLocalToScene(final float pVertices) { int count = pVertices.length / 2; int i = 0; int j = 0; while(--count >= 0) { final float x = pVertices[i++]; final float y = pVertices[i++]; pVertices[j++] = x * this.a + y * this.c + this.tx; pVertices[j++] = x * this.b + y * this.d + this.ty; } }
– AZ_
Nov 27 '12 at 5:47
hi.i am facing problem in ludo game development.i am not able to move tokens as per dice roll.like if dice displays 2 then token will move two position forward.can you give me idea about it.thanks for reply
– user1639837
May 22 '13 at 20:27