Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Fortun on Sat 20/04/2013 22:05:13

Title: How to make window with objects on screen
Post by: Fortun on Sat 20/04/2013 22:05:13
Well, that sounds "a little" weird, but i can't figure out how to name it more precisely ^^"

Ok, i will use example: let's say i have character in bedroom. There is a wardrobe with drawer in it. The effect i want to achieve is - when i click on a drawer, then on screen appears smaller window with, let's call in, "in-drawer screen", from which i can take an object. Well, now it should be easier to understand (well, i hope so... ;))

I tried to make it with GUI, but there is one problem - sure, i can make button, but there is no description about it. I also tried to use object from room, and when gui appears, then make it (that object) visible, but that didn't work either (gui covered this object).

Well, i know that it's probably noob question, but i don't know how to make it, and i haven't found answer anywhere. So, don't beat me (at least not so hard... ;))

PS. Sorry if my English is bad, but it isn't my native language, so... you know... ^^"
Title: Re: How to make window with objects on screen
Post by: Ghost on Sat 20/04/2013 22:56:55
There's a relatively simple workaround:
- You create a new room. This room's background is a dynamic sprite that you create from the original room background, so that the player and everything else are at their current positions.
- Then you impose another sprite on top of that background- your "in-drawer" screen.
- Now you have a background with all the necessary graphics, and the room can provide any objects you want to have in the drawer.
- If you simply turn the player character invisible (either via script or via room settings), nothing else is required; you have the room and all your game functionality.

[edit]
Epic facepalm- you don't even need to create that new room. Just made a sprite of your in-drawer window and copy that into the room background. Anything copied into the background will be "behind" everything else, so all you need is to set your objects' visibility, and take care that the player is NOT in a position where he overlaps the drawer window.

Check the manual for the DrawingSurface keyword- you'll find detailed (script) examples there!
Title: Re: How to make window with objects on screen
Post by: Fortun on Sun 28/04/2013 20:49:01
Oh man, i totaly forgot to reply...

Works like a charm :) Thank you very much :)