| View previous topic :: View next topic |
| Author |
Message |
chaos
Joined: 10 Apr 2005 Posts: 135
|
Posted: Mon Sep 12, 2005 5:23 pm Post subject: manipulating pixel Color |
|
|
"Color image:pixel(x, y) --get"
how can i manipulate the data from this object?
for example, if i want to know what is the red value of the pixel at 3,9 on a image.. how do i find out?
basically, i'm trying to create a fade function to fade parts of the screen, but i don't know any way to find the rgb value of a given pixel. _________________ Chaosmachine Studios: High Quality Homebrew. |
|
| Back to top |
|
 |
Shine
Joined: 03 Dec 2004 Posts: 731 Location: Germany
|
Posted: Mon Sep 12, 2005 6:58 pm Post subject: Re: manipulating pixel Color |
|
|
| Try yourColorObject:colors().r for the red component of a color object (and g, b, a for green, blue and alpha components). But I think a fading is too slow with Lua Player with this method, we need some 2D graphics library or OpenGL for it. |
|
| Back to top |
|
 |
chaos
Joined: 10 Apr 2005 Posts: 135
|
Posted: Tue Sep 13, 2005 1:20 am Post subject: |
|
|
thanks, that works.. but you're right, it's very slow :\ _________________ Chaosmachine Studios: High Quality Homebrew. |
|
| Back to top |
|
 |
|