Counting visible pixels

Started by LeChuck, Tue 05/12/2006 15:05:44

Previous topic - Next topic

LeChuck

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?

GarageGothic

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.

Squinky

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.

SMF spam blocked by CleanTalk