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 a sprite on the screen

Discussion in 'Getting Started' started by skeleton-king, Mar 23, 2015.

  1. skeleton-king

    skeleton-king

    Joined:
    Nov 10, 2014
    Posts:
    63
    How do i draw a sprite on a screen.
    For example :
    I have a gameobject named apple which as sprite of an apple.
    I want to draw the apple sprite on the screen from another object called gamemanager
     
  2. MD_Reptile

    MD_Reptile

    Joined:
    Jan 19, 2012
    Posts:
    2,663
    So when you say draw, do you mean render it? Or do you mean some effect like to look like a person drawing it?

    If you meant just display it somewhere on screen (render it), then simply create (instantiate) a sprite game object in some location, then assign that sprite to it.

    But if you already had it assigned to a game object in the scene, then just position it on screen.

    If it's a prefab, instantiate it.

    If you want some "drawing" effect... best of luck lol
     
    Ryiah likes this.
  3. skeleton-king

    skeleton-king

    Joined:
    Nov 10, 2014
    Posts:
    63
    so for displaying each sprite on screen i need to create a empty game object??
    Is there no other way to just render image on screen without creating empty game object.
     
  4. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    19,906
    One alternative would be to use particle systems, one for each sprite material, and manually positioning the particles.
     
    Last edited: Mar 23, 2015