Announcement

Collapse
No announcement yet.

MaKing IMAGES poP up when you grab Items!

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    MaKing IMAGES poP up when you grab Items!

    Question number two today

    anyway it's all for a good cause as you'll see in not too long hopefully...



    I wrote this function for my WeaponPickup Class



    class KFWeaponPickup extends UTWeaponPickup;

    function RespawnEffect()
    {

    }


    auto state Pickup
    {
    function DisplaySome****(Canvas C )
    {
    local xPlayer PC ;
    PC = xPlayer(Instigator.Controller);


    if ( ValidTouch(PC) )
    {
    C.SetPos((C.SizeX - C.SizeY) / 2,0);
    C.DrawTile( Texture'KillingfloorHUD.ClassMenu.Axe', C.SizeY, C.SizeY, 0.0, 0.0, 512, 512);
    SetRespawn();
    }
    }
    }




    Ok now very simply, i want it to display the Texture at the bottom corner of the screen for a second and then fade...so i can have that instead of the big ugly "YOU GOT XXX" colored text that is typical of unreal.

    Anyway needless to say my function doesnt quite seem to happen when i pick up said items, so can anyone lend a hand?

    #2
    As far as I know, draw functions only work on HUD classes. The only way of placing text or textures on screen is by using the HUD Class or an Interaction Class. I could be wrong, but I tried this, and only an interaction worked.


    Besides, if you don't want text thene just use

    PickupMessage=""

    in your pickup class defaults.

    Comment


      #3
      You have to call your function from a HUD class, or somewhere that HAS a canvas. You cant just toss a function in there and tell it that a canvas parameter must go there and expect the engine to call it (but man that would rock!). In other words, you need to find a place with canvas access to call your function from.

      BTW, draw functions work from anywhere, but you have to call them from somewhere that gets called every frame (like a HUD), or it will only draw once, which you would barely see.

      An interaction would work, since they get render calls. I have an interaction that puts lense flares on a sunlight actor. Pretty cool, too.

      Comment


        #4
        Only thing with weapons would be RenderOverlays, but that's just when they're actually holding the weapon. Otherwise yeah, Interactions.

        Comment

        Working...
        X