R
Raff
Guest
Hellow everyone !!!
I'm trying to make some water with reflections using surfaces. can someone tell me how i have to do it ?
i created a sprite and an object. Attached the sprite to the object and the object in the room.
I tried this but nothing reflects:
ob_water:
Create:
Draw Begin:
Draw End:
Thankyou !!!
I'm trying to make some water with reflections using surfaces. can someone tell me how i have to do it ?
i created a sprite and an object. Attached the sprite to the object and the object in the room.
I tried this but nothing reflects:
ob_water:
Create:
Code:
sw = camera_get_view_width(view_camera[0]);
sh = camera_get_view_height(view_camera[0]);
waterSurf = surface_create(sw, sh);
Code:
if(surface_exists(waterSurf))
{
surface_set_target(waterSurf);
draw_clear_alpha(0, 0);
surface_reset_target();
}
else
{
var sw = camera_get_view_width(view_camera[0]);
var sh = camera_get_view_height(view_camera[0]);
waterSurf = surface_create(sw, sh);
}
Code:
surface_set_target(waterSurf);
draw_clear_alpha(c_black, 1)
with(ob_player)
{
//var yOff = (sprite_height - sprite_yoffset) * 2;
gpu_set_blendmode_ext(bm_dest_alpha, bm_inv_dest_alpha);
//draw_sprite_ext(sprite_index, image_index, x, (y + yOff) -y, image_xscale, -image_yscale, 0, -1, 0.6);
draw_sprite_ext(sprite_index, image_index, x, y, image_xscale, -image_yscale, 0, -1, 0.6);
}
gpu_set_blendmode(bm_normal);
surface_reset_target();
draw_surface(waterSurf, sw, sh);