Search Unity

Drawing 2D graphics by code

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

  1. Enterian

    Enterian

    Joined:
    Dec 29, 2013
    Posts:
    2
    Hi!

    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.

    Thanks!
     

    Attached Files:

  2. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

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

    --Eric