Post: [C++]SPRX Hudfunctions
07-29-2014, 03:06 PM #1
ItsLollo1000
Little One
(adsbygoogle = window.adsbygoogle || []).push({});
Hey guys,
just a simple release but if someone needs them yeah then here ya go!
Those functions were made for SPRX Plugins! Choco
Use these codes with sebs HudElements.

    void moveOverTime(game_hudelem_s * elem, float time, float X, float Y)
{
int * levelTime = (int*)0x0012E0304;
elem->elem.moveStartTime = *levelTime;
elem->elem.fromAlignOrg = elem->elem.alignOrg;
elem->elem.fromAlignScreen = elem->elem.alignScreen;
elem->elem.fromX = elem->elem.x;
elem->elem.fromY = elem->elem.y;
elem->elem.x = X;
elem->elem.y = Y;
elem->elem.moveTime = (int)floor(time * 1000 + 0.5);
}

void fadeOverTime(game_hudelem_s * elem, float time, unsigned char R = 0, unsigned char G = 0, unsigned char B = 0, unsigned char A = 0)
{
int * levelTime = (int*)0x0012E0304;
elem->elem.fadeStartTime = *levelTime;
elem->elem.fromColor = elem->elem.color;
elem->elem.color.r = R;
elem->elem.color.g = G;
elem->elem.color.b = B;
elem->elem.color.a = A;
elem->elem.fadeTime = (int)floor(time * 1000 + 0.5);
}

void scaleOverTime(game_hudelem_s * elem, float time, int width, int height)
{
int * levelTime = (int*)0x0012E0304;
elem->elem.scaleStartTime = *levelTime;
elem->elem.fromWidth = elem->elem.width;
elem->elem.fromHeight = elem->elem.height;
elem->elem.width = width;
elem->elem.height = height;
elem->elem.scaleTime = (int)floor(time * 1000 + 0.5);
}

void setFlagForeground(game_hudelem_s * elem)
{
elem->elem.flags |= 0x01;
}

color_s White()
{
color_s color;
color.r = 255; color.g = 255; color.b = 255; color.a = 255;
return color;
}

void SetText(game_hudelem_s * elem, int clientIndex, const char * text, int font, float fontScale, float x, float y, int alignOrg, int alignScreen, float sort = 1, color_s color = White(), color_s glowColor = White())
{
elem->clientNum = clientIndex;
elem->elem.type = 0x01;
elem->elem.alignOrg = alignOrg;
elem->elem.alignScreen = alignScreen;
elem->elem.font = font;
elem->elem.fontScale = fontScale;
elem->elem.x = x;
elem->elem.y = y;
elem->elem.color = color;
elem->elem.glowColor = glowColor;
elem->elem.sort = sort;
elem->elem.text = G_LocalizedStringIndex(text);
}

void doTypewriterText(game_hudelem_s * elem, int clientIndex, const char * text, float x, float y, int fxLetterTime, int fxDecayStartTime, int fxDecayDuration, color_s color, color_s glowColor)
{
int * levelTime = (int*)0x0012E0304;
SetText(elem, clientIndex, "", 4, 1.9f, x, y, 0x05, 0x91);
elem->elem.fxBirthTime = *levelTime;
elem->elem.fxLetterTime = fxLetterTime;
elem->elem.fxDecayStartTime = fxDecayStartTime;
elem->elem.fxDecayDuration = fxDecayDuration;
elem->elem.color = color;
elem->elem.glowColor = glowColor;
setFlagForeground(elem);
elem->elem.text = G_LocalizedStringIndex(text);
}

void doWelcomeMessage(int clientIndex, const char* Msg1, const char* Msg2, const char* Msg3, game_hudelem_s * elem1, game_hudelem_s * elem2, game_hudelem_s * elem3)
{
color_s color;
color_s glowColor;
color.r = 255;
color.g = 255;
color.b = 255;
color.a = 255;
glowColor.r = 205;
glowColor.g = 0;
glowColor.b = 205;
glowColor.a = 255;
doTypewriterText(elem1, clientIndex, Msg1, 0, 0, 40, 7000, 1500, color, glowColor);
doTypewriterText(elem2, clientIndex, Msg2, 25, 0, 40, 7000, 1500, color, glowColor);
doTypewriterText(elem3, clientIndex, Msg3, 50, 0, 40, 7000, 1500, color, glowColor);
}

Credits to:
XOR
Const
seb5594[/CENTER]
(adsbygoogle = window.adsbygoogle || []).push({});

The following 12 users say thank you to ItsLollo1000 for this useful post:

Azus, CanadianModding, hacking247, Mx444, Notorious, Obris, SaberNGU, SnaY, Swaqq, The Kosmic, Hash847
07-29-2014, 11:09 PM #2
CanadianModding
Do a barrel roll!
nice post Winky Winky
08-01-2014, 07:27 AM #3
Taylor
Former Black Knight.
Originally posted by ItsLollo1000 View Post
Hey guys,
just a simple release but if someone needs them yeah then here ya go!
Those functions were made for SPRX Plugins! Choco
Use these codes with sebs HudElements.

    void moveOverTime(game_hudelem_s * elem, float time, float X, float Y)
{
int * levelTime = (int*)0x0012E0304;
elem->elem.moveStartTime = *levelTime;
elem->elem.fromAlignOrg = elem->elem.alignOrg;
elem->elem.fromAlignScreen = elem->elem.alignScreen;
elem->elem.fromX = elem->elem.x;
elem->elem.fromY = elem->elem.y;
elem->elem.x = X;
elem->elem.y = Y;
elem->elem.moveTime = (int)floor(time * 1000 + 0.5);
}

void fadeOverTime(game_hudelem_s * elem, float time, unsigned char R = 0, unsigned char G = 0, unsigned char B = 0, unsigned char A = 0)
{
int * levelTime = (int*)0x0012E0304;
elem->elem.fadeStartTime = *levelTime;
elem->elem.fromColor = elem->elem.color;
elem->elem.color.r = R;
elem->elem.color.g = G;
elem->elem.color.b = B;
elem->elem.color.a = A;
elem->elem.fadeTime = (int)floor(time * 1000 + 0.5);
}

void scaleOverTime(game_hudelem_s * elem, float time, int width, int height)
{
int * levelTime = (int*)0x0012E0304;
elem->elem.scaleStartTime = *levelTime;
elem->elem.fromWidth = elem->elem.width;
elem->elem.fromHeight = elem->elem.height;
elem->elem.width = width;
elem->elem.height = height;
elem->elem.scaleTime = (int)floor(time * 1000 + 0.5);
}

void setFlagForeground(game_hudelem_s * elem)
{
elem->elem.flags |= 0x01;
}

color_s White()
{
color_s color;
color.r = 255; color.g = 255; color.b = 255; color.a = 255;
return color;
}

void SetText(game_hudelem_s * elem, int clientIndex, const char * text, int font, float fontScale, float x, float y, int alignOrg, int alignScreen, float sort = 1, color_s color = White(), color_s glowColor = White())
{
elem->clientNum = clientIndex;
elem->elem.type = 0x01;
elem->elem.alignOrg = alignOrg;
elem->elem.alignScreen = alignScreen;
elem->elem.font = font;
elem->elem.fontScale = fontScale;
elem->elem.x = x;
elem->elem.y = y;
elem->elem.color = color;
elem->elem.glowColor = glowColor;
elem->elem.sort = sort;
elem->elem.text = G_LocalizedStringIndex(text);
}

void doTypewriterText(game_hudelem_s * elem, int clientIndex, const char * text, float x, float y, int fxLetterTime, int fxDecayStartTime, int fxDecayDuration, color_s color, color_s glowColor)
{
int * levelTime = (int*)0x0012E0304;
SetText(elem, clientIndex, "", 4, 1.9f, x, y, 0x05, 0x91);
elem->elem.fxBirthTime = *levelTime;
elem->elem.fxLetterTime = fxLetterTime;
elem->elem.fxDecayStartTime = fxDecayStartTime;
elem->elem.fxDecayDuration = fxDecayDuration;
elem->elem.color = color;
elem->elem.glowColor = glowColor;
setFlagForeground(elem);
elem->elem.text = G_LocalizedStringIndex(text);
}

void doWelcomeMessage(int clientIndex, const char* Msg1, const char* Msg2, const char* Msg3, game_hudelem_s * elem1, game_hudelem_s * elem2, game_hudelem_s * elem3)
{
color_s color;
color_s glowColor;
color.r = 255;
color.g = 255;
color.b = 255;
color.a = 255;
glowColor.r = 205;
glowColor.g = 0;
glowColor.b = 205;
glowColor.a = 255;
doTypewriterText(elem1, clientIndex, Msg1, 0, 0, 40, 7000, 1500, color, glowColor);
doTypewriterText(elem2, clientIndex, Msg2, 25, 0, 40, 7000, 1500, color, glowColor);
doTypewriterText(elem3, clientIndex, Msg3, 50, 0, 40, 7000, 1500, color, glowColor);
}

Credits to:
XOR
Const
seb5594[/CENTER]


Your fadeovertime throws an exception, I am using it like this:

    
Huds::fadeOverTime(TitleText[i], 900, 255, 255, 255, 255);
10-07-2014, 01:45 PM #4
Daqe
Pokemon Trainer
MoveOverTime wont start at selected position stare

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo