Post: [CODE] - Scrolling Text Added to Menu + Tutorial
02-02-2011, 02:23 AM #1
(adsbygoogle = window.adsbygoogle || []).push({}); Ok so I have this scrolling text, text that I found in a thread on another website. It is fairly simple, just type in what text you want to scroll and it will scroll. I really wanted to get this so that it would only show when my menu was up. With a little help from TheEliteMossy, I was able to achieve that, so thanks to him for the help with fixing it. Anyway this code is just meant to appear when your menu is open and close when your menu is closed, pretty basic, but I am deciding to make a tutorial anyway.

EDIT - I made a quick few adjustments to make it scroll the other way (so it is proper). Just re-paste the code, or you can see the changes i made:

I changed if ( i == 400) to if ( i == -400)
I changed i = 400; to i = -400;
I changed i++; to i--;

OK i fixed the Height! It should now be higher.

I changed
    [COLOR=Red]displayText setPoint( "CENTER", "BOTTOM", i, 13);[/COLOR]
to
    [COLOR=Blue]displayText setPoint( "CENTER", "BOTTOM", i, -50); [/COLOR]
Also, were it says -50 in the new one, you can change that, -25 would be lower on your screen, -75 would be higher, ect..


NOTE - Everything that should be kept the same with be shown in RED while everything you can change will be in BLUE
Smile

Tutorial
Ok so the first thing is to add this code to one of your .gsc's.
    [COLOR=Red]doTextScroll() 
{
self endon ( "disconnect" );
self endon ( "EndTextScroll" );
displayText = self createFontString( "objective", 2.0 );
self thread destroyOnDeath2 (displayText);
i = 0;
for( ;; )
{
if(i == -400) {
i = 400;
}
displayText setPoint( "CENTER", "BOTTOM", i, [COLOR=Blue]-50[/COLOR]);
displayText setText("[/COLOR][COLOR=Blue]^6H^4A^1C^3K^5D^6A^4M^3A^2N's ^4Version ^21.2 ^1Beast ^3Patch[/COLOR][COLOR=Red]");
wait .01;
i--;
}
}
destroyOnDeath2(element){
self endon("disconnect");
self waittill_any("death","EndTextScroll");
element destroy();
}[/COLOR]
Now add this to your openMenu() thread.
    [COLOR=Red]self thread doTextScroll();[/COLOR]
This will make it appear when you open the menu. Now add this to your menuExit() thread.
    [COLOR=Red]self notify ( "EndTextScroll" );[/COLOR]
That will make it stop scrolling, and destroy the text when you close the menu Smile

Do to a request, i will Inform you how to add this to your on-player-spawned lost Smile

Ok so this is much easier. first of all the initial thread is shorter. add this anywhere you would like:
    [COLOR=Red]doTextScroll() 
{
self endon ( "disconnect" );
displayText = self createFontString( "objective", 2.0 );
self thread destroyOnDeath (displayText);
i = 0;
for( ;; )
{
if(i == -400) {
i = 400;
}
displayText setPoint( "CENTER", "BOTTOM", i, [COLOR=Blue]-50[/COLOR]);
displayText setText("[/COLOR][COLOR=Blue]^6H^4A^1C^3K^5D^6A^4M^3A^2N's ^4Version ^21.2 ^1Beast ^3Patch[/COLOR][COLOR=Red]");
wait .01;
i--;
}
}[/COLOR]


Then, add this to your onPlayerSpawned() thead:
    [COLOR=Red]self thread doTextScroll();[/COLOR]

that's it, it will display until the match ends, or you die. Smile

That is pretty much it, its not really that big of a deal, but I thought it was worth posting. I will upload a video, when I find the time Smile
(adsbygoogle = window.adsbygoogle || []).push({});

The following 3 users say thank you to IAMSTEN for this useful post:

Brian235026, jammie01, matt944057
02-05-2011, 06:32 AM #20
Originally posted by IAMSTEN View Post
I edited the tutorial, scroll down a bit, it will tell you Smile and sorry for the late response, if you would like it faster, next time quote, because it will pop up in my notifications Smile

---------- Post added at 12:37 AM ---------- Previous post was at 12:36 AM ----------



lmao np? I guess people don't like you eh? -138 rep :P


o ok thnx man feel free to add me on psn DaxcrazyHDx i host and edit good thnx alot
02-05-2011, 05:48 PM #21
Originally posted by DaxcrazyHdx View Post
o ok thnx man feel free to add me on psn DaxcrazyHDx i host and edit good thnx alot


haha np Smile and ill see about adding you

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo