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

Creating a single colored pixel

Discussion in 'Editor & General Support' started by Vanz, Oct 8, 2014.

  1. Vanz

    Vanz

    Joined:
    Nov 19, 2013
    Posts:
    374
    I'm trying to teach Unity to some kids and I wanted to start with just drawing a single pixel in various colors and moving it around, then expand by creating a line function that contains a loop of pixels, what's a good way to just draw pixels in Unity?
     
  2. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,398
    There isn't really a simple way; normally you'd create a texture and use SetPixel but that's kind of complex for someone just starting. It would be easier to begin with the built-in primitives (cube, sphere, etc.).

    --Eric
     
    Graham-Dunnett likes this.
  3. Valette

    Valette

    Joined:
    Jun 9, 2014
    Posts:
    68
    Why don't you write the difficult bit for them and provide them with a simple WritePixel(x,y) call, displaying the results on the screen? That way, you teach them the important programming fundamentals without their needing to bother with the trickier stuff?
     
  4. Vanz

    Vanz

    Joined:
    Nov 19, 2013
    Posts:
    374
    Yes, that's what I'll do, create a SetPixel(x,y,Color); function that instantiates a tiny quad and colors it...

    Thanks,

    Vanz