Game Development Community

Blending/Color Manipulation/Invisibility

by Christian · in Torque 2D Beginner · 11/08/2013 (11:10 pm) · 2 replies

Hey,

I was attempting to make a sprite partly invisible, using the old Torque 3d .startFade and didn't see anything similar in the sprite's .dump(), is there anything equivalent for T2D?

Also ran across some pretty interesting color manipulation commands.

.blendcolor = "red";
.blendmode = "1";
.dstblendfactor = "ONE_MINUS_SRC_ALPHA";
.SrcBlendFactor = "SRC_ALPHA";

The .blendcolor is really cool for changing sprite's colors in-game, is there a list of all the colors available anywhere?

The other ones weren't very self-explanatory, but I'm looking to do a lot of color manipulation/blending on my sprites so they seemed promising at the very least. Is there some documentation or can someone explain their function?

Thanks as always,
Christian

#1
11/09/2013 (12:25 am)
I see someone hasn't read all of the wiki documentation! :-)

github.com/GarageGames/Torque2D/wiki/Blending-Guide

There are no built in fading functions for scene objects in the source, but it's not too difficult to do in TorqueScript. Have a look through my FadeInOutToy to see how it's done.

github.com/t2Dtutorials/Modules
#2
11/09/2013 (11:38 pm)
Haha, I spent hours trying to adapt the fadetoy into my program, and realized $momo.setBlendColor("1 1 1 0"); was what was needed.

Thank you Mike.