ColorInfo Class Reference
Color rendering class.
More...
List of all members.
|
Static Public Member Functions |
static void | StaticTick (float Delta) |
| Static tick function.
|
static String | RemoveColoring (String ColorGone, Optional String Filter, Optional bool bShowNecessaryTags) |
| Remove color codes.
|
static String | CorrectColors (String ColorGone) |
| Correct a message's colors.
|
static int | RenderColoredString (Canvas Canvas, float X, float Y, String Message, optional int StartOffset, optional bool bFade, optional float FadeCount, optional bool bShowSmiles, optional UWindowWindow Requestor, optional bool bNoRender, optional bool bShowTags) |
| Render a colored/smile piece of text.
|
static String | ColorLeft (String Message, int HowFar, int HowFarTotal) |
| Left with color tags accounted for.
|
static float | TrueStringSize (Canvas Canvas, String StrCheck) |
| StrLen with font sizes accounted for.
|
Public Attributes |
const Color | ColorSet [10] |
| Set solid colors.
|
const Color | TrueBlack |
| Pure black.
|
const Color | ScoreboardGreen |
| Scoreboard green.
|
const Color | DeathRed |
| Deathmessage Red.
|
const Color | NormalWhite |
| Regular white.
|
const Color | AdminMsgColor |
| Admin message color.
|
const Color | SpecSayColor |
| Specsay color.
|
const Color | IDColor |
| ID color.
|
const Color | MuteColor |
| Mute color.
|
Color | FlashColor |
| Flash color.
|
Color | RandomColor |
| Random color.
|
Detailed Description
A class that is statically accessible and can be used for all color/smilie rendering operations, as long as a Canvas can be supplied.
Member Function Documentation
static void StaticTick |
( |
float |
Delta |
) |
[static] |
Static tick function. This function must be called from the Tick() of any object on the client. If this function is not called statically, the flashing and random colors will never change.
- Parameters:
-
| Delta | The delta value from whatever calls this. |
static String RemoveColoring |
( |
String |
ColorGone, |
|
|
Optional String |
Filter, |
|
|
Optional bool |
bShowNecessaryTags | |
|
) |
| | [static] |
Remove all color codes from a piece of text.
- Parameters:
-
| ColorGone | The piece of text from which to remove color codes |
| Filter | Any color codes that should be left in. All codes should be separated with a space, i.e. "^0^ ^b^" |
| bShowNecessaryTags | If set to true and a ^C^ tag is found, all tags following it will not be removed. If set to false, then all tags will be removed, regardless of the presence of ^C^ tags. |
- Returns:
- The supplied string, will color tags removed as specified.
static String CorrectColors |
( |
String |
ColorGone |
) |
[static] |
If a message contains a player's name along with other text (i.e. a DeathMessage, name change, etc) then this function will insert tags to remove all text effects after the player's name. The player's name is considered to be the first space in a string after a text effect is noticed.
- Parameters:
-
| ColorGone | The piece of text that needs to be corrected |
- Returns:
- The given string, without the player's text effects interfering with the rest of the message
static int RenderColoredString |
( |
Canvas |
Canvas, |
|
|
float |
X, |
|
|
float |
Y, |
|
|
String |
Message, |
|
|
optional int |
StartOffset, |
|
|
optional bool |
bFade, |
|
|
optional float |
FadeCount, |
|
|
optional bool |
bShowSmiles, |
|
|
optional UWindowWindow |
Requestor, |
|
|
optional bool |
bNoRender, |
|
|
optional bool |
bShowTags | |
|
) |
| | [static] |
Renders a piece of text that may contain text effects and smilies.
- Parameters:
-
| Canvas | The canvas to draw with |
| X | The X coordinate to draw at |
| Y | The Y coordinate to draw at |
| Message | The message to render |
| StartOffset | When the end of the screen is hit, this will be the starting X coordinate on the next line |
| bFade | Whether the text is fading |
| FadeCount | If bFade is true, this specifies the degree to which it is fading. This is a number between 0.0 and 1.0 |
| bShowSmiles | Whether smiles are allowed to be rendered here |
| Requestor | The UWindow that is drawing this, if any |
| bNoRender | Whether to NOT actually render the supplied text, but instead to just calculate the line count |
| bShowTags | If this is true, then all tags will be visible |
- Returns:
- The number of lines that were taken up by this piece of text on the screen
static String ColorLeft |
( |
String |
Message, |
|
|
int |
HowFar, |
|
|
int |
HowFarTotal | |
|
) |
| | [static] |
The same as the Left() string function, but you can specify additional information with regard to effect tags.
- Parameters:
-
| Message | The string on which the function will be applied |
| HowFar | How far to go while ignoring effect tags |
| HowFarTotal | How far to go while counting effect tags |
static float TrueStringSize |
( |
Canvas |
Canvas, |
|
|
String |
StrCheck | |
|
) |
| | [static] |
The same as the StrLen() function, except font size variations in the string are accounted for.
- Parameters:
-
| Canvas | The Canvas to use for the StrLen calculations |
| StrCheck | The string whose size will be checked |
- Returns:
- The amount of horizontal space that this string occupies on the string
- See also:
- RemoveColoring
Member Data Documentation
Array of ten solid colors.
Index 0 = Red
Index 1 = Blue
Index 2 = Green
Index 3 = Yellow
Index 4 = Purple
Index 5 = Orange
Index 6 = Pink
Index 7 = Brown
Index 8 = White
Index 9 = Black
The green color used on the scoreboard.
The red color used in death messages.
The white color used for spectator text.
The color used for admin messages.
The color used for specsay message.
The color used for ID numbers on the scoreboard.
The color used to draw the mute "X" next to a muted player's name.