Announcement

Collapse
No announcement yet.

rotate textures on the HUD

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

    rotate textures on the HUD

    Is it possible to rotate textures on the HUD? I don't see any of that in-game or in the codebase, so I'm just wondering if it's a lost cause or not...

    In the likely case that I can't use the Canvas to rotate textures, I still want to be able to do it. Would there be a reasonable way to achieve this?

    #2
    Use a TexRotator.

    Comment


      #3
      Thanks for putting me on the right track, but... TexRotator is a native class, there are no comments, and there isn't any other reference to it in the UT codebase. So I'm not quite sure what to make of it. I googled for TexRotator and aside from wiki, all it turned up was a page on the UDN which wasn't that much help. Could you tell me a little bit more on how I would go about using TexRotator? Thanks.

      Comment


        #4
        I suggest you create one in UnrealEd's texture browser and play around a bit with its properties. It's actually quite simple. (And the UDN page on that topic is quite informative too in my opinion.)

        Comment


          #5
          I have done that, and played around with it in the editor, but I don't know how to access the rotation through script. You must take this sort of thing for granted, I guess. But I have only been doing UT scripting for a month or two

          This is for a minimap whose rotation is tied into the player's rotation, btw. So I need to control the rotation at runtime, not have it be a static rotating texture on a wall.

          I looked at Deathball's U file in notepad to try to get an idea of how they did their rotating radar on the bottom right (because that's pretty much exactly what I want to achieve), but with a 1 MB file it's hard to see what exactly is going on...

          Thanks

          Comment


            #6
            http://www.ataricommunity.com/forums...hreadid=310437

            that should help you. it helped me quite a bit

            Comment


              #7
              Yep, thanks! The last post on that thread was what I was after, and I've got the texture rotating fine now, and life is good...... well, almost.

              See the thing is, my minimap, ideally, should be displayed round (not square). Now for a normal texture I could find a way to use combiners (I think) to set a mask and it would be relatively straight forward. But I'm not just plopping down the entire texture (512x512) and rotating it. I'm only drawing a small section of it which pans around like a viewport as the player moves about the map. I also have it zooming in and out, and of course, rotating.

              Is there a way I could mask off the corners of this viewport (128x128 onscreen) so it would look round?

              Comment


                #8
                Eureka! Although this may be old hat to some, it was pretty obscure to me, but I found out how. It involved making a Shader, setting its Diffuse material to a TexRotator (whose texture was the original minimap texture), and setting the Opacity material to a TexScaler (whose texture was an "circle cutout" w/ alpha channel). Then all that was left is positioning and scaling the TexScaler's circle cutout every frame so it "viewed" the right part of the source image. Whew. It works though!

                Comment


                  #9
                  Does that amount of dynamically changing code impact performance any?

                  Write up a quick tute on it, its a good way to use materials!

                  Comment


                    #10
                    I don't think it has much effect on performance. It's only about 10-15 lines of simple calculations, which is dwarfed by what gets executed by pawns and controllers on a regular basis, for example. Not to mention that I don't display the standard deathmatch HUD anymore, so it's probably faster

                    However, without a profiler to work with, that's neither here nor there. All I can say is that it runs smoothly.

                    As for a tutorial, maybe in the future. Really busy now, no time

                    Comment

                    Working...
                    X