Thread: HUD Icon

Results 1 to 4 of 4
  1. #1
    edub18's Avatar
    Join Date
    Aug 2010
    Gender
    male
    Location
    Germany
    Posts
    146
    Reputation
    10
    Thanks
    12
    My Mood
    Bored

    HUD Icon

    Hey
    im trying to place an icon on the players screen. First im precaching it:
    Code:
    init()
    {
    precacheShader("cardicon_claymore");
    [...]
    }
    Then i create it:
    Code:
    self.infoIcon = createIcon("cardicon_claymore", 64, 64);
    self.infoIcon setPoint("BOTTOMRIGHT", "BOTTOMRIGHT", -10, -2);
    But its looks buggy ingame. Can anyone help me?

  2. #2
    Nachos's Avatar
    Join Date
    Jun 2010
    Gender
    male
    Location
    Between Equator and The North Pole
    Posts
    2,984
    Reputation
    176
    Thanks
    919
    My Mood
    Blah
    Code:
    notifyData = spawnstruct();
    notifyData.iconName = "rank_prestige10"; //Icon, 10th prestige
    notifyData.sound = "mp_level_up"; //Sound, level up sound here
    self thread maps\mp\gametypes\_hud_message::notifyMessage( notifyData );
    That works for me, I don't think that looks so buggy though it just pops up for a couple of seconds in the middle of the screen. I don't think that is what you want but you may be able to modify it to the corner as you want.


    Can you use some of this, it is another way than precaching but i think it works, i'm not sure and you need some more code than this to make it work but you seem to know about GSC coding.
    Code:
    	level.infoIcon = createIcon("cardicon_claymore", 64, 64);
    	level.infoIcon.alignX = "right";
    	level.infoIcon.alignY = "bottom";
    	level.infoIcon.horzAlign = "right;
    	level.infoIcon.vertAlign = "bottom";
    	level.infoIcon.y = 25;
    	level.iinfoIcon.foreground = true;
    Last edited by Nachos; 05-01-2011 at 09:19 AM.


    The lines in my Steam are i's

  3. #3
    edub18's Avatar
    Join Date
    Aug 2010
    Gender
    male
    Location
    Germany
    Posts
    146
    Reputation
    10
    Thanks
    12
    My Mood
    Bored
    Thanks but my code work well for some icons. I think some of the icon files are missing :-/

  4. #4
    Jorndel's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Location
    Norway
    Posts
    8,676
    Reputation
    905
    Thanks
    19,123
    My Mood
    Angelic

    Here you have

    Okey. Here is the code, this works and is taken from the MW2, ff files.


    self.carryIcon = createIcon( "cardicon_sniper", 33, 33 );
    self.carryIcon setPoint( "TOP", "TOP", 5, 100 );;
    And in the
    init()
    {
    precacheShader("cardicon_sniper");
    [....]
    NB: I am not sure about what number is Hight + Broad and X+ Y

    createIcon( "cardicon_sniper", 33, 33 );

    the 33 , 33 is the size of the icon.

    Hight + Broad


    self.carryIcon setPoint( "TOP", "TOP", 5, 100 );;

    5 , 100 is the place.

    X + Y

     
    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