SetTile() public méthode

public SetTile ( int x, int y, int value ) : void
x int
y int
value int
Résultat void
Exemple #1
0
 void OnClicked(int x, int y)
 {
     x /= TileWidth;
     y /= TileHeight;
     if (!ViewObjects)
     {
         room.SetTile(x, y, client.SelectedIndex);
         this.QueueDrawArea(x * TileWidth, y * TileWidth, TileWidth - 1, TileHeight - 1);
     }
     else
     {
         if (objectEditor != null)
         {
             ObjectGroupEditor editor = objectEditor;
             while (hoveringObjectIndices.Count > 1)
             {
                 editor.SelectedIndex = hoveringObjectIndices[0];
                 hoveringObjectIndices.RemoveAt(0);
                 editor = editor.SubEditor;
             }
             if (hoveringObjectIndices.Count == 1)
             {
                 editor.SelectedIndex = hoveringObjectIndices[0];
                 draggingObject       = true;
             }
         }
     }
 }
Exemple #2
0
        void OnClicked(int posX, int posY)
        {
            int x = (posX - XOffset) / TileWidth;
            int y = (posY - YOffset) / TileHeight;

            if (!ViewObjects)
            {
                if (!IsInBounds(posX, posY))
                {
                    return;
                }
                room.SetTile(x, y, client.SelectedIndex);
                this.QueueDrawArea(x * TileWidth + XOffset, y * TileWidth + YOffset, TileWidth - 1, TileHeight - 1);
            }
            else
            {
                if (objectEditor != null)
                {
                    ObjectGroupEditor editor = objectEditor;
                    while (hoveringObjectIndices.Count > 1)
                    {
                        editor.SelectedIndex = hoveringObjectIndices[0];
                        hoveringObjectIndices.RemoveAt(0);
                        editor = editor.SubEditor;
                    }
                    if (hoveringObjectIndices.Count == 1)
                    {
                        editor.SelectedIndex = hoveringObjectIndices[0];
                        draggingObject       = true;
                    }
                }
            }
        }