Results 1 to 8 of 8

Thread: Possible to move a text?

  1. #1
    Lieutenant Loveboy's Avatar
    Join Date
    Nov 2012
    Posts
    546
    Thanks
    229
    Thanked 72 Times in 46 Posts

    Possible to move a text?

    Hello Guys!
    Is it possible to move a text?

    I tested it:

    as first i precached the text in tdm.gsc

    Code:
    precacheString(&"Test");
    Then called a thread in Callback_StartGametype()

    Code:
    thread test();
    Then i created down a new thread and here is it:

    Code:
    untendertext()
    {
    	level.text = newHudElem();	
    	level.text.x = 60; //630
    	level.text.y = 450; //475
    	level.text.alignX = "left";
    	level.text.alignY = "middle";
    	level.text.sort = 1; //-3
    	level.text.alpha = 1;
    	level.text.fontScale = 0.9;
    	level.text.archived = true;
    	level.text setText(&"Test);
    
            // Now it's possible to move the text? I tested it!
            level.text movex(-320,1);
            // and hide and show too?
            while(1)
            {
                   level.text hide();
                   wait 1;
                   level.text show();
            }
    Now i have get this error:

    Code:
    not an entity: (file 'maps/mp/gametypes/tdm.gsc', line 1614)
     level.text movex(-320,1);
    So I see it's not possible.
    But there is another way to move it?

    Would be nice if you help me
    Thank you!

  2. #2
    Brigadier General
    Join Date
    Dec 2012
    Posts
    1,012
    Thanks
    440
    Thanked 171 Times in 132 Posts
    You need to use moveovertime(time);

  3. The Following User Says Thank You to Ni3ls For This Useful Post:

    Loveboy (2nd October 2013)

  4. #3
    Private First Class RobsoN's Avatar
    Join Date
    Jan 2013
    Location
    /home/cod2/
    Posts
    230
    Thanks
    119
    Thanked 95 Times in 64 Posts
    1. http://zeroy.com/script/
    2. HUD
    3. MoveOverTime


    If you want to move your hud to x = 20, code should looks like:
    PHP Code:

    time 
    1;
    self.hud MoveOverTime(time);
    self.hud.20
    Of course you can link together y and x in on one time:

    PHP Code:
    time 1;
    self.hud MoveOverTime(time);
    self.hud.20;
    self.hud.120
    Now, your hud in 1 second move to x = 20, and y = 120.
    "Don't worry if your code doesn't work correctly - if everything worked, you would not work" ~Mosher's right

  5. The Following User Says Thank You to RobsoN For This Useful Post:

    Loveboy (2nd October 2013)

  6. #4
    Lieutenant Loveboy's Avatar
    Join Date
    Nov 2012
    Posts
    546
    Thanks
    229
    Thanked 72 Times in 46 Posts
    Thank you! Btw which of the things will show the text front?

    Code:
    level.text = newHudElem();	
    	level.text.x = 60; //630
    	level.text.y = 450; //475
    	level.text.alignX = "left";
    	level.text.alignY = "middle";
    	level.text.sort = 1; //-3
    	level.text.alpha = 1;
    	level.text.fontScale = 0.9;
    	level.text.archived = true;
    	level.text setText(&"Test);

  7. #5
    Brigadier General
    Join Date
    Dec 2012
    Posts
    1,012
    Thanks
    440
    Thanked 171 Times in 132 Posts
    what do you mean with text front?

  8. #6
    Lieutenant Loveboy's Avatar
    Join Date
    Nov 2012
    Posts
    546
    Thanks
    229
    Thanked 72 Times in 46 Posts
    So that the text is front of all, it's at the moment behind all ( behind the compass )

  9. #7
    Sergeant serthy's Avatar
    Join Date
    Nov 2012
    Posts
    450
    Thanks
    96
    Thanked 296 Times in 188 Posts
    Quote Originally Posted by Loveboy View Post
    So that the text is front of all, it's at the moment behind all ( behind the compass )
    hud.sort = -1;
    hud.foreground = true;

  10. The Following 2 Users Say Thank You to serthy For This Useful Post:

    Loveboy (2nd October 2013),Ni3ls (3rd October 2013)

  11. #8
    Assadministrator IzNoGoD's Avatar
    Join Date
    Aug 2012
    Posts
    1,718
    Thanks
    17
    Thanked 1,068 Times in 674 Posts
    first set an origin (.x and .y) of your hud, then call moveovertime(time) and right after set another .x and .y of your hud to make it move.

  12. The Following User Says Thank You to IzNoGoD For This Useful Post:

    Loveboy (2nd October 2013)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •