Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Drawing 2D graphics by code

Discussion in '2D' started by Enterian, Dec 30, 2013.

  1. Enterian


    Dec 29, 2013

    I am new to Unity but not to game programming, and I am curious if Unity (2D) is the right engine for my next game project.

    I've been looking for basic tutorials that show me how to place graphics in a scene, all done by code (c#). But most tutorials show how to add graphics / game objects in a scene manually. This won't work for me as I want to give my game an isometric look, just like an older project of mine that used the Allegro4 game library (see screenshot attachment).
    To put isometric graphics on the screen I usually use a for loop and just draw all the sprites in the right order.

    Does anyone know a good basic tutorial that covers putting sprites on the screen by code?
    I have downloaded the free version of Unity 4.3.


    Attached Files:

  2. Eric5h5


    Volunteer Moderator Moderator

    Jul 19, 2006
    You can place sprites in code by using Transform.position, and set the drawing order with SpriteRender.sortingOrder.