Author Topic: acess pixel of a uisprite (getpixel)  (Read 4919 times)

nospam94

  • Guest
acess pixel of a uisprite (getpixel)
« on: March 05, 2013, 04:58:04 AM »
Hi,

i'm working on a color picker and i need to read pixel value of a sprite, i didn't find how so for now, i display the colorwheel as uisprite from uiatlas in a panel, and i read color in a texture asset. it works but it's memory waste because i have same picture in atlas and asset.

i tried to get the atlas texture access (playing with uisprite outer) but it's not readable.

can we access texture source of a sprite ?

i tried with simply uitexture but didn't seems to work as well as uisprite because shader is unlit/texture and i have transparency (is unlit/texture a requirement for uitexture ?)
« Last Edit: March 05, 2013, 05:05:43 AM by nospam94 »

nospam94

  • Guest
Re: acess pixel of a uisprite (getpixel)
« Reply #1 on: March 05, 2013, 10:41:04 AM »
Problem solved : i manage to do this with uitexture and getpixel and it works well.

but i understand that in fact i didn't need to readpixel of color wheel, i only need to get pixel coordinates on color picker texture and  deal with HSB / RGB conversion.