Page 1 of 2 12 LastLast
Results 1 to 10 of 20

Thread: Using iprintln(); to display an image?

  1. #1
    Private First Class
    Join Date
    Oct 2013
    Posts
    219
    Thanks
    56
    Thanked 105 Times in 66 Posts

    Using iprintln(); to display an image?

    I'm currently working on creating my own obituary/killfeed and am having trouble figuring out how I can display the headshot image using iprintln();

    Can iprintln(); be used to display anything other than strings? If so, any example?

    If not, I will probably seek a different way to achieve what I need.

    Cheers

  2. #2
    Brigadier General
    Join Date
    Oct 2012
    Posts
    994
    Thanks
    20
    Thanked 588 Times in 388 Posts
    Quote Originally Posted by filthy_freak_ View Post
    I'm currently working on creating my own obituary/killfeed and am having trouble figuring out how I can display the headshot image using iprintln();

    Can iprintln(); be used to display anything other than strings? If so, any example?

    If not, I will probably seek a different way to achieve what I need.

    Cheers
    No, iprintln() cannot display images - only strings. You will have to create a hud element to display images and position it where the obits are displayed.

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

    filthy_freak_ (4th January 2014)

  4. #3
    Private First Class
    Join Date
    Oct 2013
    Posts
    219
    Thanks
    56
    Thanked 105 Times in 66 Posts
    Quote Originally Posted by Tally View Post
    No, iprintln() cannot display images - only strings. You will have to create a hud element to display images and position it where the obits are displayed.
    Yeah I thought that was the case.

    Ty.

  5. #4
    Private First Class php's Avatar
    Join Date
    Nov 2012
    Posts
    142
    Thanks
    28
    Thanked 116 Times in 59 Posts
    If you were looking to change the headshot icon in the killfeed you'd just simple add a texture for that; I believe it's hud_, also I think you meant the obituary function instead of iprintln?

    Code:
    Obituary( self, attacker, sWeapon, sMeansOfDeath );

  6. #5
    Sergeant serthy's Avatar
    Join Date
    Nov 2012
    Posts
    450
    Thanks
    96
    Thanked 296 Times in 188 Posts
    if you want some extra icons, you can use MOD_CRUSH as sMeansOfDeath and change this image (its unused in CoD2).
    or youcould reuse the smokegrenades icons or the binocular one.
    if you want to change all, you have to do it with HUDs or menu's (would prefer menus)

  7. #6
    Brigadier General
    Join Date
    Oct 2012
    Posts
    994
    Thanks
    20
    Thanked 588 Times in 388 Posts
    Quote Originally Posted by php View Post
    If you were looking to change the headshot icon in the killfeed you'd just simple add a texture for that; I believe it's hud_, also I think you meant the obituary function instead of iprintln?

    Code:
    Obituary( self, attacker, sWeapon, sMeansOfDeath );
    As he clearly states in his opening post, he is working on his OWN obituary. He is not using the stock one.

  8. #7
    Private First Class
    Join Date
    Oct 2013
    Posts
    219
    Thanks
    56
    Thanked 105 Times in 66 Posts
    Small update:

    Managed to combine iprintln() and huds to come up with something like this;
    http://tinypic.com/view.php?pic=yjuoo&s=5#.Uuc1dxBe5hF

    My next problem is coming up with an easy way to calculate where the hud image X needs to be so it will place itself in the middle of each name. My only idea is to somehow manually grab the pixel length of each letter and add them up. Wondering if anyone has any other ideas?

    Edit: Would be easier to do my idea if the font was mono-spaced, any way I can do this? I believe console font is mono-spaced, but only know how to use the font in menus.
    Attached Thumbnails Attached Thumbnails yjuoo.jpg.png  
    Last edited by filthy_freak_; 28th January 2014 at 04:04.

  9. #8
    Assadministrator IzNoGoD's Avatar
    Join Date
    Aug 2012
    Posts
    1,718
    Thanks
    17
    Thanked 1,068 Times in 674 Posts
    console font is mono-spaced.

    hud.font = "console"; iirc.

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

    filthy_freak_ (28th January 2014),kung foo man (28th January 2014)

  11. #9
    Private First Class
    Join Date
    Oct 2013
    Posts
    219
    Thanks
    56
    Thanked 105 Times in 66 Posts
    ^.^ thankyou.

  12. #10
    Brigadier General
    Join Date
    Dec 2012
    Posts
    1,012
    Thanks
    440
    Thanked 171 Times in 132 Posts
    Can you post your script? Very curious how you did this

Posting Permissions

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