Documentation: "GetPixel" article is incomplete

Started by Monsieur OUXX, Mon 08/07/2013 16:46:47

Previous topic - Next topic

Monsieur OUXX

The manual doesn't say that "GetPixel()" returns -1 (constant COLOR_TRANSPARENT) on transparent pixels, even in a 32-bits game.

On a side note, that also answers the question: "how the hell do I know if a pixel is transparent, considering the top-left corner of the image is not necessarily pink in the images I import?".
 

Ryan Timothy B

I'm pretty sure AGS changes the color in the sprite of "top-left corner" etc, to COLOR_TRANSPARENT. Or that wasn't your question.

Kitai

I think M. OUXX had no question: he just points out that the manual does not (but should) say that whenever you pass the coordinates of a transparent pixel to GetPixel, it returns the value -1.
Once the user learns it, (s)he no longer wonders what value (naively the pink value) he should check for in order to know whether the pixel he's looking at is transparent or not.

Monsieur OUXX

Quote from: Kitai on Mon 08/07/2013 17:41:11
I think M. OUXX had no question: he just points out that the manual does not (but should) say that whenever you pass the coordinates of a transparent pixel to GetPixel, it returns the value -1.
Once the user learns it, (s)he no longer wonders what value (naively the pink value) he should check for in order to know whether the pixel he's looking at is transparent or not.

Exactly. I was expecting pink. Or the top-left color. I had to debug to find out that GetPixel was actually returning -1. And I had to search the forums to learn that "-1" was known as macro COLOR_TRANSPARENT.
 

SMF spam blocked by CleanTalk