Drawing something outside of the drawing surface.

Started by Retro Wolf, Sat 13/10/2018 23:30:21

Previous topic - Next topic

Retro Wolf

If I try to draw something outside of a drawing surface, say -100 on the x axis obviously the player will never see it. But I just wondered if doing this causes any problems or slow downs, does AGS even try to do something about it?

I have 320 x 200 room but my tile based game is just using this surface as a camera, so my "room" is bigger than this and I loop through all the tile data drawing them based on the player's location, so you get tiles outside of this surface.

Now I don't actually have a problem, when I loop through the tile array I can simply just check if it would potentially be drawn outside the surface, then don't call the drawing function for that tile. There will be times when partial sprites are drawn off of the surface edge however.

So again I'm not having an issue really, I was just curious if drawing outside of the surface area is bad, could potentially cause slow downs, or AGS simply doesn't do anything.

Crimson Wizard

#1
This should be very easy to test out really, but as far as I know the Allegro library used by AGS is drawing only parts of image if it is partially off-surface and not doing anything at all if its completely off surface.

Retro Wolf


SMF spam blocked by CleanTalk