SetObjectMaterialText - Transparent Background
#1

pawn Код:
new immigration = CreateObject(19353, 1492.2942,-1145.2356,24.0781, 0.0, 0.0, 0.0); //create the object
SetObjectMaterialText(immigration, "Testing 1-2-3", 0, OBJECT_MATERIAL_SIZE_256x128, "Arial", 28, 1, 0xFFFF8200, 0xFFFFFF00, OBJECT_MATERIAL_TEXT_ALIGN_CENTER);
What's wrong with this transparency-wise? I'm using the 00 alpha value which means it technically should be transparent.
Reply
#2

Colors for SetObjectMaterial/Text are ARGB, not RGBA. You might wanna change the format.

Quote:

ARGB Format

Colors we use in most of functions are defined as RGBA format colors. Its because when reading them as hexadecimal colors, we'll read them as 0xRRGGBBAA.
It means, that 0xFF0000FF will be red; R = red, G = green, B = blue and A = alpha, their values can be between 0 and 255. 00 is 0, and FF is 255. The meaning of 0xFF0000FF is 255 red, 0 green, 0 blue and 255 alpha (so the color will be visible).

Both the new functions requires ARGB format color, it means AARRGGBB. So a red color, that was 0xFF0000FF, will be now 0xFFFF0000. That's how you can turn the colors defined in your script into ARGB format colors for materials.

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)