Brenden
Member
I am using surfaces to draw this ball. I draw the ball and the shadow/highlight at an alpha of 0.3 to the surface at the same time and then draw the surface to the screen. The issue is the shadow/highlight doesn't seem to blend the way it would if I just drew it to the screen.
Here is what it would be if I drew it to the screen:
Here is what I am getting after drawing to the surface and then the surface to the screen:
The alpha of the shadow/highlight seems to just burn through the ball, showing behind the ball.
I am doing it this way because I need to rotate the ball once, then stretch it, and then rotate it again. Unfortunately you can't do this all at once in the draw_sprite_ext function.
Here is my code:
Here is what it would be if I drew it to the screen:
Here is what I am getting after drawing to the surface and then the surface to the screen:
The alpha of the shadow/highlight seems to just burn through the ball, showing behind the ball.
I am doing it this way because I need to rotate the ball once, then stretch it, and then rotate it again. Unfortunately you can't do this all at once in the draw_sprite_ext function.
Here is my code:
GML:
///Create
sufBall = surface_create(sprite_width, sprite_height);
surface_set_target(sufBall);
draw_clear_alpha(c_white, 0);
surface_reset_target();
///Draw
if (!surface_exists(sufBall)){
sufBall = surface_create(sprite_width, sprite_height);
surface_set_target(sufBall);
draw_clear_alpha(c_white, 0);
surface_reset_target();
}
surface_set_target(sufBall);
//The ball
draw_sprite_ext(sHackySack,0,sprite_width/2,sprite_height/2,1,1,image_angle,c_white,1);
//The highlight/Shadow
draw_sprite_ext(sHackySack,1,sprite_width/2,sprite_height/2,1,1,0,c_white,0.3);
surface_reset_target();
//all the vars in here ar arbitrary, if you want them I can get them to you.
draw_surface_ext(sufBall,surfX,surfY,surfW,surfH,surfRot,c_white,1);