C
Crossoni
Guest
I am trying to do something very simple, but can't seem to grasp how to do it. I have made a rectangle and inside it couple objects. What I would like them to do, is to disappear when I scroll them outside of the rectangle and reappear when I scroll them back in. So far I have tried using surfaces, but if I use surfaces it messes up all my x and y positions, but with little adjustments I can make them work correctly. But for some reason I can't click on my objects anymore. This is my code so far:
If there is any better way of doing this than using surfaces, please let me know. I heard that something called "blending" could be used too to achieve this, but I have no idea what that blending is.
Here are 2 pictures to represent what I mean:
https://imgur.com/a/IsrGErj
Code:
///Object which initializes surface
//Create event
instance_create(x1+100,y-150,obj_show_profiles);
//Draw event
if (surface_exists(surface)) {
draw_surface(surface,x1,y1);
}
Code:
///Object which uses the surface
//Draw event
if (surface_exists(obj_settings_profiles.surface)) {
surface_set_target(obj_settings_profiles.surface);
} else {
obj_settings_profiles.surface = surface_create(200,400);
surface_set_target(obj_settings_profiles.surface);
}
draw_clear_alpha(c_white,0);
draw_self();
draw_text(x,y,name);
surface_reset_target();
Here are 2 pictures to represent what I mean:
https://imgur.com/a/IsrGErj