Announcement

Collapse
No announcement yet.

Break Hud Gfx class down into several classes/files?

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

    Break Hud Gfx class down into several classes/files?

    I have a scaleform hud. It's used extensively and has a lot of functionality.

    It's currently managed through a single gfx class (as the hud is a single swf file). This class is growing in size to a point that it's hard to navigate.

    I'm wondering if there's a way to break down this class into several files (example: one to control inventory, one to control health, etc)? Is there a clean way of doing something like this, rather than just having one GFX class per swf?

    #2
    Bump. I still haven't found a way of doing this.

    Comment


      #3
      I find myself this problems to sometimes, the best it's start external instances on postbegin play or start in the case of movies, and place the functionality there, There are cases in wich separe everything in several classes, for example AI, or pawn functionalities such as Movement, such as Customization, such as even damage.
      But there are cases in wich everything together is the best option.

      I think you should start a new object, and place the functions there and call them from the new class.

      Comment


        #4
        Thanks for the response @Neongho. However in the case of gfx movies, incoming actionscript calls will always reach the single parent gfx class. I'm not sure how to have actionscript calls reach the child gfx widgets directly.

        Comment


          #5
          Could you spawn a second, third, etc. HUD? I'm not sure that's possible but might be worth looking into.

          Comment


            #6
            I've managed to achieve what I was after by setting various elements of my UI into widgets and registering them via WidgetInitialised in the main movie class. This way I cast them to a GFxObject class of my choosing and setup delegates to hook into the actionscript calls. It was a bit long-winded, but now I have my UI broken into several manageable classes.

            Documentation for this approach is here.

            Thanks for the help

            Comment

            Working...
            X