Y
Yoon-SeokJin
Guest
I got problem when I copy application_surface to surf_pause which is used to pause game.
When pausing game by pressing P key, it remain afterimage on surf_pause
I thought that this remain because surf_pause is translucent
I have known that even if draw translucent box where alpha value is 1, still alpha value is 1
However, if a translucent box is drawn on the application surface when the application surface is copied to surf_pause and then drawn, the output surface will also be translucent.
(I tried drawing surf_pause on draw_GUI event and the output of draw event was seen faintly)
I want that surf_pause is opaque.
What should I do?
Create Event:
Step Event:
When pausing game by pressing P key, it remain afterimage on surf_pause
I thought that this remain because surf_pause is translucent
I have known that even if draw translucent box where alpha value is 1, still alpha value is 1
However, if a translucent box is drawn on the application surface when the application surface is copied to surf_pause and then drawn, the output surface will also be translucent.
(I tried drawing surf_pause on draw_GUI event and the output of draw event was seen faintly)
I want that surf_pause is opaque.
What should I do?
Create Event:
Code:
is_pause = false
surf_pause = -1
Code:
if !surface_exists(surf_pause)
surf_pause = surface_create(surface_get_width(application_surface), surface_get_height(application_surface))
draw_set_alpha(0.5)
draw_rectangle(0,0,room_width, room_height, 0)
draw_set_alpha(1)
if is_pause
{
draw_surface(surf_pause, 0, 0)
}
if keyboard_check_pressed(ord("P"))
{
is_pause = !is_pause
if is_pause
{
surface_copy(surf_pause, 0, 0, application_surface)
instance_deactivate_all(1)
}
if !is_pause
{
instance_activate_all()
}
}