Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: LeChuck on Tue 05/12/2006 15:05:44

Title: Counting visible pixels
Post by: LeChuck on Tue 05/12/2006 15:05:44
I was thinking of implementing a feature where if the sun is covered by skies, the screen grows darker and vica versa. What I want for this is a script or a function that counts how many pixels of an object that are visible to the player. Is this doable?
Title: Re: Counting visible pixels
Post by: GarageGothic on Tue 05/12/2006 15:39:15
This seems like such a minor thing in a game that it's hardly worth the effort to implement in my opinion. But you might look into the AreThingsOverlapping(int thing1, int thing2) function for the clouds and sun, although it isn't pixel perfect. I'm not sure what kind of numbers it returns (the manual states they are arbitrary, so it doesn't seem to be percentages), but you should be able to re-calculate them as a value to feed into TintScreen, RawDrawFrameTransparent or whatever other method you want to use for making the screen darker.
Title: Re: Counting visible pixels
Post by: Squinky on Fri 08/12/2006 01:06:31
I am not up on the new scripting yet, but it seems to me the easiest way would be to check the status with a timer, not with collision detection.

Although, things have changed a good bit since my last game.