Post: Newsbar help
06-11-2016, 08:35 PM #1
(adsbygoogle = window.adsbygoogle || []).push({}); I want to make the tekst and the shader smaller but have no idea what numer i need to change to make it looks good.

Here is the code, hope one of u can help me out Smile

    
informationBar()
{
if (level.enableInformationBar)
{
level endon("game_ended");

level.infoBarBackground = level drawShader("white", -50, 20, 1000, 25, (0, 0, 0), 0.50, 7, true);
level.infoBarBackground.alignX = "center";
level.infoBarBackground.alignY = "bottom";
level.infoBarBackground.horzAlign = "center";
level.infoBarBackground.vertAlign = "bottom";

level.infoBarText = level drawText(level.informationBarText, "objective", 2, 1000, 16, (1, 1, 1), 1, (0, 0, 0), 0, 10, true);
level.infoBarText.alignX = "center";
level.infoBarText.alignY = "bottom";
level.infoBarText.horzAlign = "center";
level.infoBarText.vertAlign = "bottom";

for (;Winky Winky
{
if (level.infoBarText.x == -1200)
level.infoBarText.x = 1200;
else
{
level.infoBarText MoveOverTime(20);
level.infoBarText.x = -1200;
wait 25;
}
wait 0.05;
}
}
}


    drawShader(shader, x, y, width, height, color, alpha, sort, allclients)
{
if (!isDefined(allclients))
allclients = false;

if (!allclients)
hud = newClientHudElem(self);
else
hud = newHudElem();
hud.elemtype = "icon";
hud.color = color;
hud.alpha = alpha;
hud.sort = sort;
hud.children = [];
hud setParent(level.uiParent);
hud setShader(shader, width, height);
hud.x = x;
hud.y = y;
return hud;
}

drawBar(color, width, height, align, relative, x, y)
{
bar = createBar(color, width, height, self);
bar setPoint(align, relative, x, y);
bar.hideWhenInMenu = true;
return bar;
}


    drawText(text, font, fontScale, x, y, color, alpha, glowColor, glowAlpha, sort, allclients)
{
if (!isDefined(allclients))
allclients = false;

if (!allclients)
hud = self createFontString(font, fontScale);
else
hud = level createServerFontString(font, fontScale);
hud setText(text);
hud.x = x;
hud.y = y;
hud.color = color;
hud.alpha = alpha;
hud.glowColor = glowColor;
hud.glowAlpha = glowAlpha;
hud.sort = sort;
hud.alpha = alpha;

return hud;
}


and this is how it looks lol: You must login or register to view this content.
You must login or register to view this content.
(adsbygoogle = window.adsbygoogle || []).push({});
06-11-2016, 11:00 PM #2
HiddenHour
I defeated!
Originally posted by Unboundh4x View Post
I want to make the tekst and the shader smaller but have no idea what numer i need to change to make it looks good.

Here is the code, hope one of u can help me out Smile

    informationBar()
{
if (level.enableInformationBar)
{
level endon("game_ended");

level.infoBarBackground = level drawShader("white", -50, 20, 1200, 35, (0, 0, 0), 0.50, 7, true);
level.infoBarBackground.alignX = "center";
level.infoBarBackground.alignY = "bottom";
level.infoBarBackground.horzAlign = "center";
level.infoBarBackground.vertAlign = "bottom";

level.infoBarText = level drawText(level.informationBarText, "objective", 2, 1200, 26, (1, 1, 1), 1, (0, 0, 0), 0, 7, true);
level.infoBarText.alignX = "center";
level.infoBarText.alignY = "bottom";
level.infoBarText.horzAlign = "center";
level.infoBarText.vertAlign = "bottom";

for (;Winky Winky
{
if (level.infoBarText.x == -1200)
level.infoBarText.x = 1200;
else
{
level.infoBarText MoveOverTime(20);
level.infoBarText.x = -1200;
wait 25;
}
wait 0.05;
}
}
}


What are the arguments of your drawShader function? They should tell you the x, y, width, and height.
06-12-2016, 10:53 AM #3
Originally posted by TheHiddenHour View Post
What are the arguments of your drawShader function? They should tell you the x, y, width, and height.


i added the extra info u asked, could u help me out further as look how it is now :S You must login or register to view this content.
06-12-2016, 11:05 AM #4
and i want to have the shader like this with th text in in You must login or register to view this content.
06-12-2016, 11:10 AM #5
HiddenHour
I defeated!
Originally posted by Unboundh4x View Post
and i want to have the shader like this with th text in in You must login or register to view this content.


Try this
    informationBar()
{
if (level.enableInformationBar)
{
level endon("game_ended");

//drawShader(shader, x, y, width, height, color, alpha, sort, allclients)
level.infoBarBackground = level drawShader("white", 0, 220, 900, 18, (0, 0, 0), 0.50, 7, true);
level.infoBarBackground.alignX = "center";
level.infoBarBackground.alignY = "center";
level.infoBarBackground.horzAlign = "center";
level.infoBarBackground.vertAlign = "center";

//drawText(text, font, fontScale, x, y, color, alpha, glowColor, glowAlpha, sort, allclients)
level.infoBarText = level drawText(level.informationBarText, "objective", 2, 1000, 220, (1, 1, 1), 1, (0, 0, 0), 0, 10, true);
level.infoBarText.alignX = "center";
level.infoBarText.alignY = "center";
level.infoBarText.horzAlign = "center";
level.infoBarText.vertAlign = "center";

for (;Winky Winky
{
if (level.infoBarText.x == -1200)
level.infoBarText.x = 1200;
else
{
level.infoBarText MoveOverTime(20);
level.infoBarText.x = -1200;
wait 25;
}
wait 0.05;
}
}
}
06-12-2016, 11:27 AM #6
thanks for helping!! You must login or register to view this content. just the text needs to be scaled now
06-12-2016, 11:33 AM #7
HiddenHour
I defeated!
Originally posted by Unboundh4x View Post
thanks for helping!! You must login or register to view this content. just the text needs to be scaled now


Do you want me to fix the y coordinates or do you mean that you got it :primesponge:
06-12-2016, 11:36 AM #8
i know how to fix the xy coordinates just the text needs to be smaller now, any idea how? sorry for being such a noob at this.. :L
06-12-2016, 11:44 AM #9
HiddenHour
I defeated!
Originally posted by Unboundh4x View Post
i know how to fix the xy coordinates just the text needs to be smaller now, any idea how? sorry for being such a noob at this.. :L


This is your function to draw text
drawText(text, font, fontScale, x, y, color, alpha, glowColor, glowAlpha, sort, allclients)

See how it says fontScale as the third one? Using the order of the arguments, we can find out what number we need to mess with.

This is your text
level.infoBarText = level drawText(level.informationBarText, "objective", 2, 1000, 220, (1, 1, 1), 1, (0, 0, 0), 0, 10, true);

Look at the third one in the order. It's 2. If you want to make it smaller, then decrease the number. The fontscale of text goes by .1, so try changing it to something like 1.8 and see if it fits.
06-12-2016, 11:55 AM #10
HiddenHour
I defeated!
Originally posted by Unboundh4x View Post
i know how to fix the xy coordinates just the text needs to be smaller now, any idea how? sorry for being such a noob at this.. :L


By the way, I fixed the coordinates thing and the text too.
    informationBar()
{
if (level.enableInformationBar)
{
level endon("game_ended");

//drawShader(shader, x, y, width, height, color, alpha, sort, allclients)
level.infoBarBackground = level drawShader("white", 0, 420, 900, 18, (0, 0, 0), 0.50, 7, true);
//level.infoBarBackground setPoint("center", "center", 0, 220);

//drawText(text, font, fontScale, x, y, color, alpha, glowColor, glowAlpha, sort, allclients)
level.infoBarText = level drawText(level.informationBarText, "objective", 1.7, 1000, 417, (1, 1, 1), 1, (0, 0, 0), 0, 10, true);
//level.infoBarText setPoint("center", "center", 1000, 220);

for (;Winky Winky
{
if (level.infoBarText.x == -1200)
level.infoBarText.x = 1200;
else
{
level.infoBarText MoveOverTime(20);
level.infoBarText.x = -1200;
wait 25;
}
wait 0.05;
}
}
}

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo