How to plot tiles/sprites to a world pixel position?

I’m creating a 2D game in 2D mode and I want to plot tiles based on a pixel position. Is there an easy way to plot tiles (Sprites) to a world container with the origin at the very top, left of the world, and the greatest, positive x,y at the very bottom, right?

My game will have a world which encompasses the entire map, but the user will only see what’s in the viewport (obviously).


I have a 2D array of 64x64 tiles. I want to stack them like this:

Sprite[,] map = new Sprite[20,30];
int tileWidth = 64; //pixels
int tileHeight = 64; //pixels

for(int i = 0; i<map.GetLength(0); i++){
  for (int y = 0; y<map.GetLength(1); y++){
    //how do I position the tiles/sprites?


this is for instantiating tiles in a 2D world. you should define tile counts and sizes for both x and y axes. also I assume you will have a prefab for the tile.

void Tiles(){
 for(int i = 0; i<xCount; i++){
  for (int y = 0; y<yCount; y++){
   tilePos = new Vector2(i * xSize, -y * ySize);
   Instantiate(tilePrefab, tilePos, Quaternion.identity);

I’m not sure what you are trying to achieve exactly, or at least you can provide something about the game concept, you may get more precise help.