how to convert the position ?

Results 1 to 3 of 3
  1. #1
    Member saskybad is offline
    MemberRank
    Jan 2012 Join Date
    Riqueza (SantaLocation
    66Posts

    how to convert the position ?

    how to convert the position in coordinate X , Y ??

    Exemple Position 1310775 = X? Y?


  2. #2
    Hardcore Member Stricted is offline
    MemberRank
    Feb 2012 Join Date
    GermanyLocation
    234Posts

    Re: how to convert the position ?

    Code:
    	function decode_pos($pos) {
    		$position = array();
    		$position['X']  = ($pos >> 16);
    		$position['Y']  = $pos ^ ($position['X'] << 16);
    		return $position;
    	}
    Code:
    	function encode_pos($X, $Y) {
    		return ($X << 16) | $Y;
    	}
    for other functions u can check this php class https://gist.github.com/Stricted/b5026822564d916b7058
    Last edited by Stricted; 08-06-16 at 01:13 AM.

  3. #3
    Member saskybad is offline
    MemberRank
    Jan 2012 Join Date
    Riqueza (SantaLocation
    66Posts

    Re: how to convert the position ?

    Tks My friend



Advertisement