Post: [RELEASE] Center Menus!
12-25-2011, 06:42 PM #1
Blackstorm
Veni. Vidi. Vici.
(adsbygoogle = window.adsbygoogle || []).push({}); Okay, so I told DaftVader I would make a script to center a string for his credits =D Well here it is:

    
centerString( array )
{
maxSize = 0;
trimSize = 0;
tempStr = "";
for ( i = 0; i < array.size; i++ )
if( array[i].size > maxSize )
maxSize = array[i].size;
for ( i = 0; i < array.size; i++ )
{
tempStr = "";
if( array[i].size < maxSize )
{
trimSize = ceil( maxSize - array[i].size );
for ( x = 0; x < trimSize; x++ )
tempStr += " ";
tempStr += array[i];
array[i] = tempStr;
}
}
return array;
}


Basically what this does, is spaces out each string in each array depending on the biggest string to give it a "centered" effect.

how to use:

    

function()
{
array[0] = "Hello";
array[1] = "Why Hello There";
array[2] = "penis";
array[3] = "lol";

menuString = buildString( centerString( array ) );

menu setText( menuString );
}
centerString( array )
{
maxSize = 0;
trimSize = 0;
tempStr = "";
for ( i = 0; i < array.size; i++ )
if( array[i].size > maxSize )
maxSize = array[i].size;
for ( i = 0; i < array.size; i++ )
{
tempStr = "";
if( array[i].size < maxSize )
{
trimSize = ceil( maxSize - array[i].size );
for ( x = 0; x < trimSize; x++ )
tempStr += " ";
tempStr += array[i];
array[i] = tempStr;
}
}
return array;
}


buildString( array )
{
str = "";
for ( i = 0; i < array.size; i++ )
str += array[i] + "\n";
return str;
}


This is for people who don't like their menus aligned or whatever, although this can be used for other things Upside Down Happy
(adsbygoogle = window.adsbygoogle || []).push({});

The following 11 users say thank you to Blackstorm for this useful post:

aerosoul94, Correy, IELIITEMODZX, ItsLollo1000, Jacob-And-Britt, Karoolus, KCxFTW, Mango_Knife, John, Rebuged, x_DaftVader_x
12-27-2013, 12:29 AM #20
Originally posted by Blackstorm View Post
Kind of...
you lucky bastard, I got fuck all :-/
12-28-2013, 05:23 PM #21
Jacob-And-Britt
I’m too L33T
Originally posted by codybenti View Post
I tried keeping the COD4 section alive.
We all tried :( it was a lost cause we just couldent stand a chance against rtm. Personally i hate rtm i wish everyone could switch back to gsc!
12-28-2013, 06:31 PM #22
Originally posted by Britt View Post
We all tried :( it was a lost cause we just couldent stand a chance against rtm. Personally i hate rtm i wish everyone could switch back to gsc!


I wish GSC wasn't permanently patched for every COD game (except MW1 & WAW) but it has and everyone including myself has to rely on RTM.
I personally don't have an issue with RTM as I'm learning to make my own tools but the truth is RTM sucks compared to GSC.
12-28-2013, 07:56 PM #23
Jacob-And-Britt
I’m too L33T
Originally posted by codybenti View Post
I wish GSC wasn't permanently patched for every COD game (except MW1 & WAW) but it has and everyone including myself has to rely on RTM.
I personally don't have an issue with RTM as I'm learning to make my own tools but the truth is RTM sucks compared to GSC.
I dont think its patches i think theres some encryption involved. People i guess doesnt see the point to work for months on trying to decrypte it for each cod considering they make one every year! Do you have a skype?

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo