GML Surface error - Trying to grab data from outside surface bounds

Discussion in 'Programming' started by Aaron Craig, Dec 30, 2018.

  1. Aaron Craig

    Aaron Craig Member

    Joined:
    Jun 20, 2016
    Posts:
    31
    Hey there,
    I've got a room of width 1000px and height 2000px. I'm attempting to create a sprite from the surface using the function sprite_create_from_surface(), using the application surface as the base, it works sometimes, but in strange ways.
    If I'm near the top of the map, it will function properly, creating the sprite and capturing the right area. But If I'm about halfway down, it doesn't capture anything. When I debug anything about the captured sprite, it just says "Trying to grab data from outside surface bounds: x = 0, y = 1400, w = 800, h = 600". The coordinates are what I'm trying to capture, and the w and h are my camera properties.
    Nothing appears at all when I try to capture a sprite in an area outside of bounds, and about half of my room appears to be outside the bounds.
    Any idea why this happens or how to get around it? I'm attempting to do some fancy transitions using surfaces, but it certainly won't work if I can't use the application surface on rooms that aren't tiny.
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice