PiBoSo Official Forum

GP Bikes => Suggestions and wishlist => Topic started by: HornetMaX on February 29, 2016, 02:27:41 PM

Title: Quads with sprites
Post by: HornetMaX on February 29, 2016, 02:27:41 PM
@PiBoSo: one cool thing to have for plugins is the ability to have quads with sprites being affected by the color, both in terms of color and alpha.

In the video below, look at the radar cross: it's a simple .png and one can programmatically change its transparency (make it disappear, fading in and out).
Also, when a car gets in the "dangerous zone", there's another sprite that appears on the left or right, and its color can be changed programmatically (from yellow to orange).

I guess that in both cases, the sprites are just images with stuff drawn in white over a transparent background and the alpha specified in the code (or the color component specified in the code) just "multiplies" the one of the .png/.tga

https://www.youtube.com/v/v0EdqeHXLI0

Example: sprite is fully white and opaque (ABGR = [255, 255, 255, 255]), I create a quad with that sprite and color [128, 0, 0, 255].
--> What will be shown on screen is fully red and half transparent.

Let me know if I didn't explain this clearly enough, I'm not 100% sure :)
Title: Re: Quads with sprites
Post by: PiBoSo on March 05, 2016, 03:07:40 PM

Done.
It will be integrated in all future releases.
Title: Re: Quads with sprites
Post by: HornetMaX on March 05, 2016, 03:14:13 PM
Excellent, thanks !