Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: bx83 on Sun 09/06/2019 09:17:59

Title: Can I copy a section of the screen background and then draw it back to screen?
Post by: bx83 on Sun 09/06/2019 09:17:59
I'm having a problem (or design fault :P) with walk behinds.

I want to:
1. take a picture of the background+characters
2. activate (ie. reset base) the walk behinds
3. draw the picture of the background and affected character back to screen, so the character is not half wiped out by the walkbehind.

Is there a simple way of doing this?

1. http://redrom.ltd/img/image002.png - background and ape character as they are
2. http://redrom.ltd/img/image001.png - ape wiped out by walkbehind activating for main character Julius

I just want to take a localised screen shot of (1), and draw it back when (2) happens.

There are two separate walk-behinds - one for the wall, one for the bars. I want bars to always be active; the wall 'hole' should only be active when Julius is walking towards it and about to climb through it.
Title: Re: Can I copy a section of the screen background and then draw it back to screen?
Post by: morganw on Sun 09/06/2019 11:40:10
Was this to remove something that was covering the hole? If so, it would probably be easier to just change the transparency on the object that is covering the hole. You can create a dynamic sprite from the background and do what you are asking, but I would imagine there is a simpler solution (region check on the floor and check which direction you are facing).
Title: Re: Can I copy a section of the screen background and then draw it back to screen?
Post by: bx83 on Sun 09/06/2019 12:12:00
No this was to cover the edge of the hole, so Julius can 'climb' into it.
http://redrom.ltd/img/image3.png
Title: Re: Can I copy a section of the screen background and then draw it back to screen?
Post by: Cassiebsg on Sun 09/06/2019 13:39:25
Why don't you just make the cage+bars an object with alpha transparency instead of making it part of the BG? Seems like a simpler solution to me.
Title: Re: Can I copy a section of the screen background and then draw it back to screen?
Post by: Crimson Wizard on Sun 09/06/2019 15:16:39
It's possible to edit backgrounds, but IMHO that's a last resort. Like others suggested above, objects are usually far more convenient way to achieve this.

In general I may recommend to imagine your room as a sequence of layers, similar to how you do when drawing it in the good image editor like Photoshop. Then room background is the bottom layer, and objects are other layers.