Wabbajackalope
Member
i am using the following code to blend two objects on a surface together to create one item visually and have run into a problem related to what colours are used.
the following code is based off the youtube video on metaballs linked to at the bottom of this page
specifically the problem lies in how the "way" variable is represented, if i use 0 or 255 for the colours then the object appears fine, but if i try to use partial variables (for instance to make an orange metaball) then i end up with an item that looks more yellow than orange and their is a change in colour from the outside going into the center, which isnt present if i pick red or green or aqua.
please note, if i draw an orange metaball without the surface, it is correctly coloured, but going through the surface it turns more yellow with an orange ish outline, so im at a loss.
is their something i am doing wrong with the surfaces? how could i correct the drawing system so that the colours of objects i choose will be correctly represented on screen?
thank you.
the following code is based off the youtube video on metaballs linked to at the bottom of this page
specifically the problem lies in how the "way" variable is represented, if i use 0 or 255 for the colours then the object appears fine, but if i try to use partial variables (for instance to make an orange metaball) then i end up with an item that looks more yellow than orange and their is a change in colour from the outside going into the center, which isnt present if i pick red or green or aqua.
please note, if i draw an orange metaball without the surface, it is correctly coloured, but going through the surface it turns more yellow with an orange ish outline, so im at a loss.
is their something i am doing wrong with the surfaces? how could i correct the drawing system so that the colours of objects i choose will be correctly represented on screen?
thank you.
Code:
var way = make_colour_rgb(255,128,000);
if surface_exists(surf)
{
if instance_exists(obj_ball)
{
surface_set_target(surf);
draw_clear_alpha(way,0.5);
draw_set_blend_mode(bm_add);
with(obj_ball)
{
draw_sprite_ext(sp_ball,0,x,y,image_xscale,image_yscale,0,way,1)
}
draw_set_blend_mode(bm_normal);
surface_reset_target();
draw_set_alpha_test(true);
draw_set_alpha_test_ref_value(200);
draw_surface(surf,0,0)
draw_set_alpha_test(false);
}
}else{
surf = surface_create(room_width,room_height);
}
Last edited: