Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   Code Gallery (https://forums.graalonline.com/forums/forumdisplay.php?f=179)
-   -   findAreaTiles (https://forums.graalonline.com/forums/showthread.php?t=134258357)

Cubical 03-12-2010 01:23 PM

findAreaTiles
 
I needed these momentarily for comparing tiles, doubt it will be of any help but who knows.

findAreaTiles returns a list of the tiles in the given area.
findAreaTiles2 returns a list of tiles in the given area and the x/y coordinates of said tiles in the following format "tile,x,y".

Parameters:
NPC Code:

findAreaTiles(x,y,width,height);
findAreaTiles2(x,y,width,height);



PHP Code:

function findAreaTiles(tx,ty,tw,th){
    for(
temp.i=0temp.< (tw*th); temp.i++){
      if(
temp.tw){
        
temp."0";
        
temp.j++;
      } else 
temp.q++;
      
temp.tilearray.add(tiles[tx+temp.q,ty+temp.j]);
    }
    return 
temp.tilearray;
}

function 
findAreaTiles2(tx,ty,tw,th){
    for(
temp.i=0temp.< (tw*th); temp.i++){
      if(
temp.tw){
        
temp."0";
        
temp.j++;
      } else 
temp.q++;
      
temp.tilearray.add(tiles[tx+temp.q,ty+temp.j] @ "," tx+temp."," ty+temp.j);

    }
    return 
temp.tilearray;




All times are GMT +2. The time now is 04:03 PM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.