image_color - Change color_surface and rendertarget clear-color
true or false
image_color( vid:dst, number:red, number:green, number:blue )
image_color( vid:dst, number:red, number:green, number:blue, number:alpha
)
There are two uses for this function. The first is that it can be used to update
the current color that a color_surface uses as the color value passed
to the shader. The second is that each rendertarget, including the one hidden
behind WORLDID has a clear color which is the default 'background'
color. This initialises to 25, 25, 25, (255) which is a dark grey value, but
can be updated via the use of this function.
- 1
- trying to set this on a non-rendertarget, textured surface is a terminal
state transition.
function image_color0()
local a = color_surface(64, 64, 255, 0, 0);
show_image(a);
image_color(a, 0, 255, 0);
end
function image_color1()
image_color(WORLDID, 255, 0, 0, 0);
end
function image_color0()
image_color(BADID);
end
function image_color1()
local img = fill_surface(64, 64, 0, 0, 0);
image_color(img, 255, 0, 0, 0);
end
color_surface(3) define_rendertarget(3)