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.

SetPixel

Discussion in 'Project Tiny' started by zhoushiyurop, Dec 9, 2018.

  1. zhoushiyurop

    zhoushiyurop

    Joined:
    Dec 9, 2018
    Posts:
    3
    Hi, I want to know how to setPixel using tiny mode, thanks!
     
    Berzee likes this.
  2. sebastianm_unity

    sebastianm_unity

    Unity Technologies

    Joined:
    May 3, 2018
    Posts:
    21
    There is no setPixel API in Tiny - and it's unlikely there ever will be one. Tiny uses WebGL rendering, which has no efficient way to set individual pixels.
    We do plan to add an API to upload Image2D components from memory in the future though.
     
  3. MBest_Unity

    MBest_Unity

    Unity Technologies

    Joined:
    May 4, 2018
    Posts:
    18
    Can I ask what your hoping to do with setPixel? I want to make sure I frame your need correctly.
     
  4. zhoushiyurop

    zhoushiyurop

    Joined:
    Dec 9, 2018
    Posts:
    3
    I am going to make a coloring game.I need some area of the multi-line diagram to fill the color. Can you give me some advice, thank you so much!
     
    Berzee likes this.
  5. zhoushiyurop

    zhoushiyurop

    Joined:
    Dec 9, 2018
    Posts:
    3
    I need to fill the color I want in the pixel location specified on the sprite...
     
    Berzee likes this.
  6. Berzee

    Berzee

    Joined:
    Sep 3, 2013
    Posts:
    11
    I also am interested in this. (Not for any immediate purpose, but it seems like something that always comes up -- for palette swapping shenanigans if nothing else).
     
  7. MBest_Unity

    MBest_Unity

    Unity Technologies

    Joined:
    May 4, 2018
    Posts:
    18
    Thanks for the info. Certainly agree on the value and I have had need of setPixel in the past. Appreciate the insight on what your looking to do. I’ve added this to the feature request list.
     
  8. Sarkahn

    Sarkahn

    Joined:
    Jan 9, 2013
    Posts:
    440
    I realize this is from a couple years ago now - just wondering if SetPixel is still something being considered?
     
  9. AbdulAlgharbi

    AbdulAlgharbi

    Unity Technologies

    Joined:
    Jul 27, 2018
    Posts:
    319
    Hi
    We don't have support for setting a single pixel
    You can still upload an array of pixels as a texture and use it