Author Topic: Transparency when setting up background.  (Read 304 times)

Transparency when setting up background.
« on: 05 Dec 2017, 16:16 »
Hello,

First post, I'm just getting started with AGS and it's helped me get more done in a weekend than I've gotten done in 3 years.

Right now I'm trying to put a house with a transparent background over the top of a sky that is changing from day to night throughout the game. I started coding this game in AS3 and created a background swf that got the job done, but I'm not sure how I'd do here. What would be the best way to achieve this? I originally figured I could make the sky my background image for each room, but is it possible to animate it within AGS or would i have to add code?

Snarky

  • Global Moderator
  • Mittens Earl
  • Private Insultant
    • I can help with proof reading
    •  
    • I can help with translating
    •  
Re: Transparency when setting up background.
« Reply #1 on: 05 Dec 2017, 16:20 »
If you want to minimize coding, the easiest thing is to have the sky as an object and the house and other scenery as another object on top of that. (Together they should hide the actual background completely, but I would put an image of what they look like together as the background, just because it makes it easier when you do things like draw walkable areas.)

You will probably have to add a bit of code to keep track of the time of day and set the sky graphic accordingly (it depends a little on how exactly you want it to work in-game). I wrote a module to keep track of day-night cycles that could possibly be helpful.
« Last Edit: 05 Dec 2017, 16:23 by Snarky »

Re: Transparency when setting up background.
« Reply #2 on: 05 Dec 2017, 16:49 »
thanks for the advice! i'll take a look at the tutorial, there will be three sky cycles over the same game. my goal was to split it into thirds. it would be going from sunny to dusk, then once it hit dusk it would stay there until you completed all the necessary tasks. the next third would go from dusk to sunset, and the last would go from sunset to dark.

it's gonna take a minute to get there, so i'll check the tutorial first. excited to finally have this game moving, i've drawn almost 180 screens for it over the last 10 years just working on it on and off.

Re: Transparency when setting up background.
« Reply #3 on: 05 Dec 2017, 18:58 »
In changing my background to a static sky and my house into an object, it's changed some of the coding.

When baseline override is true, my character is there, but my walk behinds create transparency and my background shows through them.
When baseline override is false, my character disappears(bad), but the walk-behind is no longer visible on the screen (good). The character is still functioning, because the screen changes when he hits hotspots.

Respectively, my walk-behind baseline is set horizontally at the bottom of the screen, below the walk-behind area.
Baseline overridden FALSE is on the house(an object).

I'm just trying to get the character to be visible without the walk-behinds creating transparency through the house.

Snarky

  • Global Moderator
  • Mittens Earl
  • Private Insultant
    • I can help with proof reading
    •  
    • I can help with translating
    •  
Re: Transparency when setting up background.
« Reply #4 on: 05 Dec 2017, 20:13 »
Ah, yes. If you make your scenery an object, you probably won't be able to rely on walkbehinds. One solution would be to make the walkbehind layers into objects themselves. Or you could use the object only for the part of the scenery that is against the sky, and use the background with walkbehinds for the bit below the horizon. It really depends a lot on the composition of your screen.

Re: Transparency when setting up background.
« Reply #5 on: 05 Dec 2017, 20:23 »
that did it, man thanks.

this way is better for me because it's similar to z layering in action script. preshiate the help!