Add a tile with a label indicating its tiling position.
506131
def _add_tile(self, new_tile, ijk):
        
        tile_label = "{0}_{1}".format(self.name, '-'.join(str(d) for d in ijk))
        self.add(new_tile, label=tile_label, inherit_periodicity=False)
1063426
def addBeam(beamState, labeling):
    
    if labeling not in beamState.entries:
        beamState.entries[labeling] = BeamEntry()
498489
def label(self,x,y,label,offset=[0,0]):
        """"""
        (xc,yc)=self.p2c([x,y])
        return self.create_text(xc-offset[0],yc-offset[1],text=label)
217088
def describe_tile(self, index):
        """"""

        if index >= len(self.tile_manager.registered_tiles):
            tile = TileInfo.CreateInvalid()
        else:
            tile = self.tile_manager.registered_tiles[index]

        return tile.registration_packet()
876751
def _center_tile(self, position, size):
        x, y = position
        w, h = size
        """"""
        return x + (self.cell_width - w) / 2, y + (self.cell_height - h) / 2
912193
function(x, y){
            var result = [];

            var entity = this.entityManager.get(x, y);
            if(entity){
                result.push(entity);
            }

            // add items or any other objects that can be placed at a tile coord position

            return result;
        }
423471
def bounds(ctx, tile):
    """"""
    click.echo(
        '%s %s %s %s' % TilePyramid(
            ctx.obj['grid'],
            tile_size=ctx.obj['tile_size'],
            metatiling=ctx.obj['metatiling']
        ).tile(*tile).bounds(pixelbuffer=ctx.obj['pixelbuffer'])
    )
998752
function pixelToTileCoords(x, y, v) {
         var q, r;
         var ret = v || new me.Vector2d();

         if (this.staggeraxis === "x") {
           //flat top
           x = x - (this.staggerindex === "odd" ? this.sideoffsetx : this.tilewidth);
         } else {
           //pointy top
           y = y - (this.staggerindex === "odd" ? this.sideoffsety : this.tileheight);
         } // Start with the coordinates of a grid-aligned tile


         var referencePoint = me.pool.pull("me.Vector2d", Math.floor(x / (this.columnwidth * 2)), Math.floor(y / (this.rowheight * 2))); // Relative x and y position on the base square of the grid-aligned tile

         var rel = me.pool.pull("me.Vector2d", x - referencePoint.x * (this.columnwidth * 2), y - referencePoint.y * (this.rowheight * 2)); // Adjust the reference point to the correct tile coordinates

         if (this.staggeraxis === "x") {
           referencePoint.x = referencePoint.x * 2;

           if (this.staggerindex === "even") {
             ++referencePoint.x;
           }
         } else {
           referencePoint.y = referencePoint.y * 2;

           if (this.staggerindex === "even") {
             ++referencePoint.y;
           }
         } // Determine the nearest hexagon tile by the distance to the center


         var left, top, centerX, centerY;

         if (this.staggeraxis === "x") {
           left = this.sidelengthx / 2;
           centerX = left + this.columnwidth;
           centerY = this.tileheight / 2;
           this.centers[0].set(left, centerY);
           this.centers[1].set(centerX, centerY - this.rowheight);
           this.centers[2].set(centerX, centerY + this.rowheight);
           this.centers[3].set(centerX + this.columnwidth, centerY);
         } else {
           top = this.sidelengthy / 2;
           centerX = this.tilewidth / 2;
           centerY = top + this.rowheight;
           this.centers[0].set(centerX, top);
           this.centers[1].set(centerX - this.columnwidth, centerY);
           this.centers[2].set(centerX + this.columnwidth, centerY);
           this.centers[3].set(centerX, centerY + this.rowheight);
         }

         var nearest = 0;
         var minDist = Number.MAX_VALUE;
         var dc;

         for (var i = 0; i < 4; ++i) {
           dc = Math.pow(this.centers[i].x - rel.x, 2) + Math.pow(this.centers[i].y - rel.y, 2);

           if (dc < minDist) {
             minDist = dc;
             nearest = i;
           }
         }

         var offsets = this.staggeraxis === "x" ? offsetsStaggerX : offsetsStaggerY;
         q = referencePoint.x + offsets[nearest].x;
         r = referencePoint.y + offsets[nearest].y;
         me.pool.push(referencePoint);
         me.pool.push(rel);
         return ret.set(q, r);
       }
1355853
def add(self, label):
        
        self._labels[label.id] = label
        self._dirty = True
498389
function (renderer, x, y, tmxTile) {
            var tileset = tmxTile.tileset;
            // draw the tile
            tileset.drawTile(
                renderer,
                ((this.cols - 1) * tileset.tilewidth + (x - y) * tileset.tilewidth >> 1),
                (-tileset.tilewidth + (x + y) * tileset.tileheight >> 2),
                tmxTile
            );
        }
970538
private void CheckTiles(IFD ifd, IfdTags metadata, int n) {
    long offset;
    int id;

    // Check Tile Offsets
    id = TiffTags.getTagId("TileOffsets");
    offset = metadata.get(id).getFirstNumericValue();
    int no = metadata.get(id).getCardinality();
    if (offset <= 0)
      validation.addError("Invalid value for field " + TiffTags.getTag(id).getName(), "IFD" + n,
          offset);

    // Check Tile Byte Counts
    id = TiffTags.getTagId("TileBYTECounts");
    offset = metadata.get(id).getFirstNumericValue();
    int nc = metadata.get(id).getCardinality();
    if (offset <= 0)
      validation.addError("Invalid value for field " + TiffTags.getTag(id).getName(), "IFD" + n,
          offset);

    if (no != nc) {
      validation.addErrorLoc("Inconsistent tile lengths", "IFD" + n);
    }

    // Check Tile Width
    long tileWidth = 0;
    id = TiffTags.getTagId("TileWidth");
    if (!metadata.containsTagId(id))
      validation.addErrorLoc("Missing required field for tiles " + TiffTags.getTag(id).getName(),
          "IFD" + n);
    else {
      tileWidth = metadata.get(id).getFirstNumericValue();
      if (tileWidth <= 0)
        validation.addError("Invalid value for field " + TiffTags.getTag(id).getName(), "IFD" + n,
            tileWidth);
    }

    // Check Tile Length
    id = TiffTags.getTagId("TileLength");
    long tileLength = 0;
    if (!metadata.containsTagId(id))
      validation.addErrorLoc("Missing required field for tiles " + TiffTags.getTag(id).getName(),
          "IFD" + n);
    else {
      tileLength = metadata.get(id).getFirstNumericValue();
      if (tileLength <= 0)
        validation.addError("Invalid value for field " + TiffTags.getTag(id).getName(), "IFD" + n,
            tileLength);
    }

    long tilesPerImage =
        ((metadata.get(TiffTags.getTagId("ImageWidth")).getFirstNumericValue() + tileWidth - 1) / tileWidth)
            * ((metadata.get(TiffTags.getTagId("ImageLength")).getFirstNumericValue() + tileLength - 1) / tileLength);

    // Check Plannar Configuration
    id = TiffTags.getTagId("PlanarConfiguration");
    int idspp = TiffTags.getTagId("SamplesPerPixel");
    if (metadata.containsTagId(id) && metadata.containsTagId(idspp)) {
      long planar = metadata.get(id).getFirstNumericValue();
      long spp = metadata.get(idspp).getFirstNumericValue();
      if (planar == 2) {
        long spp_tpi = spp * tilesPerImage;
        if (ifd.getImageTiles().getTiles().size() < spp_tpi) {
          validation.addErrorLoc("Insufficient tiles", "IFD" + n);
        }
      }
    }
  }
910250
function tileToPixelCoords(q, r, v) {
         var x, y;
         var ret = v || new me.Vector2d();

         if (this.staggeraxis === "x") {
           //flat top
           x = q * this.columnwidth;

           if (this.staggerindex === "odd") {
             y = r * (this.tileheight + this.sidelengthy);
             y = y + this.rowheight * (q & 1);
           } else {
             y = r * (this.tileheight + this.sidelengthy);
             y = y + this.rowheight * (1 - (q & 1));
           }
         } else {
           //pointy top
           y = r * this.rowheight;

           if (this.staggerindex === "odd") {
             x = q * (this.tilewidth + this.sidelengthx);
             x = x + this.columnwidth * (r & 1);
           } else {
             x = q * (this.tilewidth + this.sidelengthx);
             x = x + this.columnwidth * (1 - (r & 1));
           }
         }

         return ret.set(x, y);
       }
846739
public synchronized void promote(Tile tile)
    {
        if (tileQueue.contains(tile))
        {
            try
            {
                tileQueue.remove(tile);
                tile.setPriority(Tile.Priority.High);
                tileQueue.put(tile);
            }
            catch (Exception ex)
            {
                ex.printStackTrace();
            }
        }
    }
1320436
function tileToPixelCoords(x, y, v) {
         var ret = v || new me.Vector2d();
         return ret.set((x - y) * this.hTilewidth + this.originX, (x + y) * this.hTileheight);
       }
827005
def move(self, d, add_tile=True):
        
        if d == Board.LEFT or d == Board.RIGHT:
            chg, get = self.setLine, self.getLine
        elif d == Board.UP or d == Board.DOWN:
            chg, get = self.setCol, self.getCol
        else:
            return 0

        moved = False
        score = 0

        for i in self.__size_range:
            # save the original line/col
            origin = get(i)
            # move it
            line = self.__moveLineOrCol(origin, d)
            # merge adjacent tiles
            collapsed, pts = self.__collapseLineOrCol(line, d)
            # move it again (for when tiles are merged, because empty cells are
            # inserted in the middle of the line/col)
            new = self.__moveLineOrCol(collapsed, d)
            # set it back in the board
            chg(i, new)
            # did it change?
            if origin != new:
                moved = True
            score += pts

        # don't add a new tile if nothing changed
        if moved and add_tile:
            self.addTile()

        return score
526666
def is_valid_tile(self, x, y):
        """"""
        x = int(x)
        y = int(y)

        if x < 0:
            return False
        if y < 0:
            return False
        if x > self.size_in_tiles.X:
            return False
        if y > self.size_in_tiles.Y:
            return False

        return True
256476
public DJAreaChartBuilder addSerie(AbstractColumn column, String label) {
		getDataset().addSerie(column, label);
		return this;
	}