surface = surface_create(width,height);
surface_set_target(surface);
This is just an example of how simple it is to set up surfaces and put focus onto them. And with this comes an amazing amount of possibilities:
> You only need to draw things once on a surface; which is good for speed issues...
> You can stretch and manipulate a surface such as would it be a sprite
> You can draw it tiled, which is highly useful for room decorations and more, yet again something that would be devastating to the memory if done with draw functions
And then there is one more great opportunity that will solve our problem, with which this article begun. You can save parts from a surface! This does not neccesarily mean that the sprite or picture or whatever you try to screenshot has to be in view, or even in the room. You can save it anyway, as long as the sprite is drawn onto the surface and the surface exists (anywhere...). Here is the function:
surface_save_part(id,fname,x,y,w,h)
For a complete overview of surfaces I would suggest the manual. There is no better.
Thanks for reading
Comments
Loading comments...