• Welcome to PiBoSo Official Forum. Please login or sign up.
 
April 19, 2024, 11:21:50 PM

News:

World Racing Series beta14 available! :)


Quads with sprites

Started by HornetMaX, February 29, 2016, 02:27:41 PM

Previous topic - Next topic

HornetMaX

February 29, 2016, 02:27:41 PM Last Edit: February 29, 2016, 03:53:15 PM by HornetMaX
@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 :)

PiBoSo


Done.
It will be integrated in all future releases.
"La perfezione non è il nostro obiettivo, è la nostra tendenza".

HornetMaX