Importing TintColor in a XNA 4.0 game

Mar 14, 2011 at 3:18 PM

Hi! Recently we've passed our game from XNA 3.1 to XNA 4.0. We use your great app Gleed2d to design our levels. But now, we've realised that since we have changed to XNA 4.0, when we read TintColor from the xml file, in Level.cs, instead of reading RGBA color, it reads BGRA color. We use TintColor a lot in our level design, so it makes all look different.

We are using your Gleed2D 3.1 version, the one you have on release. We think it's something wrong with the PackedValue value, but we are not sure. Perhaps in XNA 3.1 when they read color they use the R G B A values, but now in XNA 4.0 they read PackedValue, and they are not refering to the same color.

Any clue?


Mar 16, 2011 at 8:44 PM

in xna 4.0 they changed the order of the colors.

BTW - i have converted this editor to 4.0 - it is available in my fork

Mar 18, 2011 at 7:09 AM

If you are lazy, you can do:

physicsObject.color.R = TintColor.B;

physicsObject.color.G = TintColor.G;

physicsObject.color.B = TintColor.R;

physicsObject.color.A = TintColor.A;


Although, as serioussam909 points out if you move to 4.0 it will be compatible.

Mar 18, 2011 at 11:35 AM

I did that lazy thing for the moment. But I'm trying to move my xml to the gleed2d 4.0 version, and there are somethings that dosen't look the same. I'll try to figure it out, and if I have more questions I let you know.

Thanks both for your help!!