Announcement

Collapse
No announcement yet.

[Solved]Can´t show Texture on Scaleform HUD

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

    [Solved]Can´t show Texture on Scaleform HUD

    Hi,

    I have problems to create a note Invetory like in Amnesia or Outlast where you can switch trough the notes. I have started with a class that stores the collected notes as Textures:

    Code:
    class SpottedNotizInventar extends GFxMoviePlayer;
    
    var array<Texture2D> NotizenListe;
    var Texture2D Notevalue, test;
    
    function Tick(float DeltaTime)
    {
        local int i;
        
        for(i=0; i <NotizenListe.length; i++){
            Notevalue = NotizenListe[i];
            break;
        }
    }
    
    function AddNote(Texture2D notiz)
    {
       /*     NotizenListe.length = ; */
        NotizenListe.AddItem(notiz);
    }
    
    defaultproperties
    {
        test=Texture2D'Notizen.Textures.notiz_ingame'
    }
    I also have created a note class that can be collected:
    Code:
    class SpottedNotiz extends UsableActor
            placeable;
    
    var() Texture2D note;
    var() Material notizMat;
    var StaticMeshComponent MyMesh;
    
    simulated function PostBeginPlay()
    {
        MyMesh.SetMaterial(0, notizMat);
    }
    
    function bool UsedBy(Pawn User)
    {
        local bool used;
        local SpottedNotizInventar SpInv;
    
        SpInv = new class'SpottedGame.SpottedNotizInventar';
        used = super.UsedBy(User);
     
        if (IsInInteractionRange)
        {
            SpInv.AddNote(note);
            PlaySound(SoundCue'A_Pickups.Ammo.Cue.A_Pickup_Ammo_Link_Cue'); //Put your own sound cue here. And ideally, don't directly reference assets in code.
            Destroy();
            return true;
        }
        return used;
    }
    
    defaultproperties
    {
        Begin Object Name=MyMesh
            StaticMesh=StaticMesh'Notizen.Props.notiz'
        End Object
    
    }
    But now I don´t know how I can show them as textures to the player with scaleform or canvas any ideas?

    #2
    Ill look at Ben Franke's IMshooter code...in theHud class he has this:

    Code:
    // Draws the rage mode overlay
    function DrawRageModeOverlay()
    {
        local float ScaleFactor;
        local int PosY;
        
        Canvas.SetPos(0, 0);
        Canvas.SetDrawColor(255, 0, 0);
        DrawCenteredText("Raging!", 0.25);
        
        // This is necessary to keep the overlay centered
        PosY = (SizeY - 1024) / 2;
        Canvas.SetPos(0, PosY);
        
        // Scalingfactor is based on the sceen resolution
        ScaleFactor = SizeX / 1024;
        Canvas.SetDrawColor(255, 255, 255);
        Canvas.DrawTexture(Texture2D'Path to Texture(e.g CH_Ironguar.Materials.<Texture Name>', ScaleFactor);
    }
    That draws a textue to hud

    Comment


      #3
      I tried your Suggestion Kelt'ar but the texture doesn´t show up. Also I think this method would be better http://udn.epicgames.com/Three/Scale...ading%20Images but still the texture doesn`t show on HUD (I tried several links to textures).

      Here is the Init function of the changed script:
      Code:
      var array<Texture2D> NotizenListe;
      var Texture2D Notevalue, test;
      var GFxObject RootMC, MyImageLoader;
      
      
      //Called from STHUD'd PostBeginPlay()
      function Init(optional LocalPlayer LocPLay)
      {
          //Gets all the other intialization stuff we need.
          super.Init (LocPlay);
      
          //Starts the GFx Movie that's attached to this script (IE: our HUD).
          Start();
      
          //Advances the frame to the first one.
          Advance(0.f);
      
          //Flash video finden
          RootMC = GetVariableObject("_root");
      
          MyImageLoader = RootMC.GetObject("NotizLoader");
      
          `log("Video inhalt gefunden?" @ RootMC);
          `log("Notiz Element gefunden?" @ MyImageLoader);
      }
      
      function SetRenderTexture()
      {
          SetExternalTexture("NotizLoader", test);
          `log("Texture Festgelegt");
      }
      So i´m a bit confused. What could be wrong?

      Edit:
      I don´t have any idea what could be the problem I have tried everthing what I can found in the forum and nothing works.
      Is there maybe a other method to get a text on hud with the orginal formatting (beside string because of the length of the text)

      Comment


        #4
        I know how to use scaleform to show a texture to hud, but I don't know how to control it. YouTube udk rearview mirror.

        Comment


          #5
          Ok after some testing and solving some problems I could figure it out wit the SetExternalTexture() functon for scaleform https://www.youtube.com/watch?v=408KpiU0IUA

          Thanks for your help!

          Comment


            #6
            Notice. I tried to use a sequwnce action to turn the texture on and off and decide what texture was dewing displayed. No joy

            Comment


              #7
              Is it possible to use kismet to make the texture slide off and off the screen?

              Comment

              Working...
              X