view_surface_id question

SQGTDev

Member
Is it possible to set the view_surface_id for a view to a surface, draw only a few sprites to that surface, then set the view_surface_id to another surface and draw everything else there?
I can't seem to do this and I'm wondering if you can only set the view_surface_id to one surface per frame.

This is an abridged version of what I'd like to do:

GML:
surface_set_target(world_surface);
view_set_surface_id(0, world_surface);

with (obj_game_object)
    draw_self();
    
surface_reset_target();
surface_set_target(display_surface);
view_set_surface_id(0, display_surface);

//Apply Shader then draw game surface
draw_surface(world_surface, view_x1_get(), view_y1_get());
//End Shader

//Draw HUD and Debug Hitboxes unaffected by shader
with (obj_game_object)
    draw_hitbox_list();
When I try this, my first surface will have sprites drawn to it, but the drawing will ignore the view and essentially draw with the view stuck at 0, 0. Only my second surface will actually draw according to the view position. I'm not sure if this is a bug or just how the view_surface_id works?
 
Top