Vice City: Multiplayer
VC:MP Discussion => Support => Bugs and Crashes => Topic started by: [R3V]Kelvin on May 9th, 2021, 11:03 PM
Using Colour() within a GUILabel element constructor will fail to set label's alpha. Its alpha will always be initialized at 255. However, if you decide to use label.Colour = Colour( r, g, b, a ); or label.Alpha = alpha; it will just work fine.
What you were doing when the bug happened
Attempting to initialize a GUILabel element with alpha set to 0 using Colour() in its constructor:
label <- null;
::label = ::GUILabel( ::VectorScreen( ::GUI.GetScreenSize().X * 0.48, ::GUI.GetScreenSize().Y * 0.51 ), ::Colour( 255, 255, 255, 0 ), "Hello there." );
What you think caused the bug
No idea. This bug seems to be affecting GUILabel elements only.
Have you tried using label.TextColour?
I think you're misunderstanding what the colour parameter is for. In this case, colour refers to the colour of the text (and by extension text alpha) and not the alpha value of the overall label.
So simply put:
set the alpha (and colour) value of the label itself, whereas the colour parameter in this code:
GUILabel(VectorScreen(0, 0), Colour(255, 255, 255, 0), "Colour!");
sets the colour and alpha of the text only, so it's effectively doing the same as:
Hope this helps.