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
Actual board of the game



but when i get the coordinates and maps on the Screen of the emulator it shows like this..



enter image description here



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










share|improve this question






















  • 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















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
Actual board of the game



but when i get the coordinates and maps on the Screen of the emulator it shows like this..



enter image description here



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










share|improve this question






















  • 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













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
Actual board of the game



but when i get the coordinates and maps on the Screen of the emulator it shows like this..



enter image description here



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










share|improve this question













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
Actual board of the game



but when i get the coordinates and maps on the Screen of the emulator it shows like this..



enter image description here



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






share|improve this question













share|improve this question











share|improve this question




share|improve this question










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


















  • 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












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






share|improve this answer





















  • 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


















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.






share|improve this answer





















    Your Answer






    StackExchange.ifUsing("editor", function () {
    StackExchange.using("externalEditor", function () {
    StackExchange.using("snippets", function () {
    StackExchange.snippets.init();
    });
    });
    }, "code-snippets");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "1"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    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

























    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






    share|improve this answer





















    • 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















    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






    share|improve this answer





















    • 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













    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






    share|improve this answer












    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







    share|improve this answer












    share|improve this answer



    share|improve this answer










    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


















    • 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












    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.






    share|improve this answer

























      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.






      share|improve this answer























        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.






        share|improve this answer












        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.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Mar 19 '13 at 12:59









        Khawar Raza

        7,4562258115




        7,4562258115






























            draft saved

            draft discarded




















































            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.




            draft saved


            draft discarded














            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





















































            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







            Popular posts from this blog

            How to change which sound is reproduced for terminal bell?

            Title Spacing in Bjornstrup Chapter, Removing Chapter Number From Contents

            Can I use Tabulator js library in my java Spring + Thymeleaf project?