So tiles are relative to the screen and not the scene?

Fool

  • Posts: 88
I got some code that iterates through each column and row, and outputs the tile row and column. This uses the get column/row
blocks.

I have a placeholder that moves with WASD, and I noticed my tiles always go from 0 to 12, no matter where the character is in the scene.

Do I need to factor in the camera position? And if so, why does the get tile blocks not account for camera position?
I tried putting the tile retrieval code in the placeholder, but anything to the actor suddenly is a negative tile, and everything to the right of it is a positive tile, and so forth.

What am I doing wrong?

gurigraphics

  • Posts: 690
Yes. You need add the camera position: TilePositionX + CamPositionX, TilePositionY + CamPositionY.

Hectate

  • *
  • Posts: 4643
Tile rows and columns are always relative to the top-left of the scene. Remember; the camera moves around in the scene - the tileset is fixed in place.
:
:
Patience is a Virtue,
But Haste is my Life.
Proud member of the League of Idiotic Stencylers; doing things in Stencyl that probably shouldn't be done.

Fool

  • Posts: 88
Tile rows and columns are always relative to the top-left of the scene. Remember; the camera moves around in the scene - the tileset is fixed in place.

Thanks for confirming this Guri.

Hectate, I think you mean to say the tiles are relative to the screen? Otherwise, wouldn't the position of the camera be irrelevant?

letmethink

  • *
  • Posts: 2545
I believe Hectate is correct with what he is saying. How are you checking the tile row or column?

« Last Edit: June 25, 2016, 03:45:44 pm by letmethink »
~Letmethink

Fool

  • Posts: 88
I'm drawing to tiles by using (column or row + camera offset) * 64