-
Notifications
You must be signed in to change notification settings - Fork 912
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How do I read screen buffer? #316
Comments
To read the screen, it is just a sprite like any other, but it is considered the draw target. So you can GetDrawTarget()->GetPixel() to retrieve a value. Notes: decals are not sprites so this won't work; also doing pixel based collision using the screen buffer is likely not a great way in most circumstances. |
Great! thanks for clarifying. |
You'd represent the track as a polygon, even if it's not rendered as such. That way geometry comes to the rescue and makes things spatially invariant and simple(ish) to compute |
thanks a lot for the suggestion! btw, thanks a lot for this amazing tool! |
hello,
I have read the whole wiki documentation but I could not find a way to actually read the pixel status (aka R,G,B) of the rendered window. It seems a bit strange to me that such a basic info is actually not there.
Just for reference, here is how you read the pixel status of a Sprite:
The reason why I find this info important us because I imagine this is the way you work out how different sprites can interact between them when you cannot use their sizes as in the simple pong example in the documentation. Right?
In my case I have a large .png sprite that defined a race circuit and I need to read where the track is located (based on color) so that cars don't drive outside it.
The text was updated successfully, but these errors were encountered: