TA: Kingdoms Community Forum
 
HomePortalCalendarGalleryFAQSearchMemberlistUsergroupsRegisterLog in

Share | 
 

 Wqaopl's tnt maker

View previous topic View next topic Go down 
Go to page : Previous  1, 2
AuthorMessage
Wqaopl

avatar

Posts : 212
Reputation : 0
Join date : 2008-08-14

PostSubject: Re: Wqaopl's tnt maker   Fri Aug 12, 2016 9:58 am

ok i found out the sizing of the tab its to fit in the battle screan as states by the game GUI (431 512) and will scale to fit in.

_________________
There are loads of modern ideas but new ideas are rare.
Back to top Go down
View user profile
$_Spagg

avatar

Posts : 386
Reputation : 16
Join date : 2010-10-31
Age : 104
Location : Brazil

PostSubject: Re: Wqaopl's tnt maker   Fri Aug 12, 2016 11:30 am

Thanks your post I think I got it, the final formula is along the lines of:

Code:

    const int w = 511;
    const int h = 431;

    // these are the size inputs in cartographer
    int x = 10;
    int y = 10;

    // 64 and 16 come from the red areas that are cut for the tab map
    double px = (x * 256) - 16;
    double py = (y * 256) - 64;

    double scale = (py < h) ? (w / px) : (h / py);
    int resultX = (py < h) ? 0 : 1;
    int resultY = (py < h) ? 1 : 0;

    resultX += (px * scale);
    resultY += (py * scale);

    printf("x: %d\ny: %d\n", resultX, resultY);

Some of the conditions (py < h) were put deliberately and I still need to test other dimensions
I only tested from the dimensions 1x1 ... 10x10 (only same sized dimensions, still need to test uneven dimensions like 3x4 etc) and they were all correct
Back to top Go down
View user profile
 
Wqaopl's tnt maker
View previous topic View next topic Back to top 
Page 2 of 2Go to page : Previous  1, 2
 Similar topics
-
» Siggy Maker Shop!!!
» Kitten Or Puppy Maker Shop(OPEN)
» Tech Editor/Maker
» ? Game Maker Tutorials ?
» Super Mario Maker

Permissions in this forum:You cannot reply to topics in this forum
TA: Kingdoms Community Forum :: GENERAL :: General Chat-
Jump to: