Results 1 to 7 of 7
  1. #1
    dsds1's Avatar
    Join Date
    Aug 2011
    Gender
    male
    Posts
    63
    Reputation
    10
    Thanks
    2
    My Mood
    Fine

    Wink text writing on screen

    hello everybody, I am here to present the tutorial for how to make text on screen like zomie mods(cash and health)

    1.Important thing
    the information could help you making text screen properly
    so you see:
    Code:
    self.newtext setText("here:" + self.perks);
    so you could see above, right?
    anyway you see the 'here' in quotes "" that cuz 'here' is unique text, like in C++ you must put quotes cuz word 'here' is not value, this is memory varaible(see http://www.mpgh.net/forum/279-call-d...s-structs.html)

    but you see the plus with value?this is addition with integer value, so in-game it will be like this if self.perks is equals 1:
    Code:
    here:1
    2.beginning
    creating and locating input text:
    first, you must add new hud element like:
    Code:
    onPlayerSpawned() 
    { 
     self endon("disconnect"); 
            self.showpage = NewClientHudElem( self );
    	self.showpage.alignX = "center";
    	self.showpage.alignY = "bottom";
    	self.showpage.horzAlign = "center";
    	self.showpage.vertAlign = "bottom";
    	self.showpage.y = -25;
    	self.showpage.foreground = true;
    	self.showpage.fontScale = 0.9;
    	self.showpage.font = "objective";
    	self.showpage.color = ( 1.0, 2.0, 1.0 );
    instead of showpage, you could name it anything else like 'newtext', but all other struct must have same name as struction like:
    Code:
    self.newtext = NewClientHudElem( self ); 
    self.newtext.alignX = "center"; 
    self.newtext.alignY = "bottom";
    and like this, congrats you created basic input text
    and you see, there is new structs with dot (.), this is structing the new hud elem, here is what text writing onscreen must have
    Code:
    self.newtext.alignX
    you see the alignX struct? this is to anchor locate where you put self.newtext .... Horizontal
    but you see thats it assigned with "center"
    it means anchor the text in center in horizon
    the list of aligning point is:
    "center"
    "left"
    "right"

    and you see
    Code:
    .alignY
    this is also required struct, this is for VERTICAL
    the list of variables assigning it for achor:
    "middle"
    "top"
    "bottom"

    but you see the
    Code:
    .horzAlign
    this is same to alignX but must be either existed and must same to alignX (you,ve put alignX in center and you must put center also to horzAlign)

    and
    Code:
    .vertAlign
    is same but for alignY

    lesson 3:
    coordinates:
    so you see struct
    Code:
    .y
    this is not anchor point of text, this is to move the text vertical by float number
    the float number is BIG, it could have decimal
    1.2
    and it could be negative and positive!
    -1.2

    but you are asking, you already put the center in alignY, but this is to change
    it just like telling your brother to sit in center of room but after minutes you told him to move a little

    but you see, moving text a little must have much bigger number for example you put .y = 50, but it didn't put at the point you want, then you put .y = 51, you will NEVER see the point changed, so you make it .y = 100, and soon you will see it moved a LITTLE

    the positive float number to move down from anchor point, and the negative to move up from anchor point
    note:this struct could be optional

    and
    you see the optional coordinate struct is
    Code:
    .x
    this more like .y but to move horizontal, and negative to move left and positive to move right

    lesson 4:
    ending and creating
    and the required struct is
    Code:
    .font
    the font is font style, list of font style
    "default", // HE_FONT_DEFAULT
    "bigfixed", // HE_FONT_BIGFIXED
    "smallfixed",// HE_FONT_SMALLFIXED
    "objective"
    "hudbig"

    and either required struct is
    Code:
    .fontScale
    this is font size, and could be positive float number
    NOTE:the font size is much different then coordinate pointing, just change it a bit and it will be bigger that you could see the difference
    ppl mostly use only
    X.X number (X is any number digit)

    and you see the structs
    Code:
    .color
    just copy and paste from example I either IDK

    Ending:
    and you have command for texting and output and it could be in after playerspawned, and it could be change-able,
    Code:
    self.newtext setText("text");
    and you could change it for example while the player is in this place
    Code:
    self.newtext setText("change");
    hope helped

    PRESS THANKS BUTTON
    Last edited by dsds1; 09-01-2011 at 07:50 AM.

  2. #2
    Heartview's Avatar
    Join Date
    May 2010
    Gender
    male
    Location
    KY Cygni
    Posts
    9,208
    Reputation
    717
    Thanks
    2,872
    Moved to GSC Discussions.
    Texture Mods


    Obedear, the sky is low

  3. #3
    cgallagher21's Avatar
    Join Date
    Jun 2010
    Gender
    male
    Posts
    1,584
    Reputation
    11
    Thanks
    296
    My Mood
    Busy
    You shoulda made the thread name a bit less confusing, see I thought u needed help but next time either add this to the Snippets Vault or use the prefix [Tutorial]

    And you know there's a much simpiler way of displaying text.

  4. #4
    dsds1's Avatar
    Join Date
    Aug 2011
    Gender
    male
    Posts
    63
    Reputation
    10
    Thanks
    2
    My Mood
    Fine
    Quote Originally Posted by cgallagher21 View Post
    You shoulda made the thread name a bit less confusing, see I thought u needed help but next time either add this to the Snippets Vault or use the prefix [Tutorial]

    And you know there's a much simpiler way of displaying text.
    I know, but in the simple way you can't edit the text or destroy it
    Press thanks if I helped you
    my English grammar not good

  5. #5
    Jorndel's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Location
    Norway
    Posts
    8,675
    Reputation
    905
    Thanks
    18,544
    My Mood
    Angelic
    You did a Nice job here.
    But messy but that is okey.

    You should really think about using colors and so.

     
    Contributor 01.27.2012 - N/A
    Donator 07-17-2012 - Current
    Editor/Manager 12-16-12 - N/A
    Minion 01-10-2013 - 07.17.13
    Former Staff 09-20-2012 - 01-10-2013 / 07-17-2013 - Current
    Cocksucker 20-04-2013 - N/A

  6. #6
    Yamato's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Posts
    839
    Reputation
    13
    Thanks
    152
    My Mood
    Amazed
    Good job,

  7. #7
    Nachos's Avatar
    Join Date
    Jun 2010
    Gender
    male
    Location
    Between Equator and The North Pole
    Posts
    2,986
    Reputation
    176
    Thanks
    913
    My Mood
    Blah
    Very messed up and chaotic. Kinda useless too because of: http://www.mpgh.net/forum/286-call-d...c-modding.html and http://www.mpgh.net/forum/308-call-d...s-snipets.html

    And because there have been posted so many [Help request] topics about text.

    Good job anyway...

    Offtopic
    Yes, i do have something against all your posts. They are so messed up. At least TRY to make it look just a little clean.
    Last edited by Nachos; 09-02-2011 at 11:26 AM.


    The lines in my Steam are i's

Similar Threads

  1. Text on my Screen
    By apache-wd-forum in forum Call of Duty Modern Warfare 2 GSC Modding Help/Discussion
    Replies: 11
    Last Post: 06-16-2011, 08:10 AM
  2. [TUT]How to read and write to a text file
    By XORxHACK in forum Java
    Replies: 18
    Last Post: 02-26-2010, 05:41 PM
  3. Writing to Text File
    By ppl2pass in forum Visual Basic Programming
    Replies: 10
    Last Post: 02-22-2010, 09:19 PM
  4. Selecting An Option In Combobox and Writing Code In Text
    By ppl2pass in forum Visual Basic Programming
    Replies: 11
    Last Post: 02-14-2010, 01:18 PM
  5. grab text and write text from address
    By CodeHPro in forum Visual Basic Programming
    Replies: 4
    Last Post: 08-30-2009, 12:14 PM