No announcement yet.

Splitscreen for singleplayer

  • Filter
  • Time
  • Show
Clear All
new posts

    Splitscreen for singleplayer


    I'm currently researching about achieving a splitscreen based application using scaleform.
    The reason why I bolded out splitscreen is to address that it's not a typical splitscreen usage such as for multiplayer.

    My goal is to vertically split the screen in 2 parts having:
    - left side: a scene
    - right side: the same scene but mirrored vertically

    It's a visualization project so no actual players will be active (think of it more as singleplayer).

    The question I'm asking myself, is this the way to go.
    Scaleform provides some info but this is very limited and since the old UIScene isn't supported anymore, it's more about trial and error at this time.

    Thanks in advance.

    Everything you need to know is in the post you linked, at least the Scaleform part. If you try to implement this, and run into trouble though, please ask for help here and we'll be happy to assist you.


      Hey Matt,

      My problem is not quite the same, but I also followed the instructions posted by Kinetomatics but had no success. Here's my original post:

      I'm working on a character selection screen for a game where I want (at least) two players choosing their characters. As of now, the buttons on the .swf file receive focus for the two players (using 360 gamepads) but they are both controlling the same focus. I don't know how to create a separate focus for the second player. I followed this tutorial but had no success.

      Maybe the tutorial is outdated (because SetControllerFocusGroup is a static function in the FocusManager class, not in the Selection class) but I followed it anyway. I created the two focus groups and in the .fla file, I created the 4 states mentioned in the tutorial: state0 for no focus, state1 for player 1, state2 for player 2 and state3 for both players focusing on the same button. Didn't work. Matt Doyle mentioned that he was going to post some videos but I can't seem to find them. I'll appreciate it if anyone can point me in the right direction. Thanks.

      P.S.: By the way, I'm using the March 2012 UDK build.


        FYI -

        If you download and install the July 2012 UDK, it includes a working demo of multi controller/ split screen support.

        \Development\Flash\AS3\CLIK\demos\MultipleControll ers_Main.fla

        Which uses a custom class found here:

        \Development\Flash\AS3\CLIK\demos\com\scaleform\de mos\

        This should get you on your way.


          Hey Matt,

          I've followed the MultipleControllers example but to no avail. Ultimately, two controllers are still linked to the same input. This is how i attempted to create separate focus groups:

          // Setup two focus groups
          FocusManager.setControllerFocusGroup(0, 0); // controller id 0
          FocusManager.setControllerFocusGroup(1, 1); // controller id 1

          I was hoping this would link controller 1 to focus group 0 and controller 2 to focus group 1. However, when i move about the menu with the second controller, it moves the first controller's focus.

          What should I do to separate the input for each controller?

          Thank you,


            Just setting the ControllerFocusGroup is not enough. You also have to specify which controller can use which UI widgets. So, if you look at the demo I told you about, you can see in the code:

            FocusManager.setFocusGroupMask( panel1, 0x1 );
            FocusManager.setFocusGroupMask( panel2, 0x2 );
            FocusManager.setFocusGroupMask( panel3, 0x1 | 0x2 );
            This sets the panel1 movie clip to only allow input from the controller mapped to 0x1 (controller 1), and panel2 can only be accessed by the controller at 0x2 (controller 2), while panel 3 can be accessed by both.

            And, initial focus for each controller must also be set:

            // Set the initial focuses to appropriate focus group (value is a bitmask)
             panel1.r1.focused = 0x01; // Focus group 0
             panel2.r1.focused = 0x02; // Focus group 1
            These values (0x01, 0x02) are bitmasks. Google the term to learn more about how to use them. But, you really should study the demo more to understand it. It works, so if you copy it, you will be ok.


              Hey Matt,

              Thank you for the reply. However, I must apologize for not fully explaining my issue. I have indeed set my needed FocusGroupMasks and used those in conjunction with initial focus to restrict which UI widgets my controllers can access.

              However, my problem is that my controllers do not control different input. For example, if I move with controller 0 then move with controller 1, they will both move the same input. How can I ensure that each controller has access to its own separate input?

              Thank You,


                That's how (what I wrote above). Have you run the multi-controller demo from July 2012 UDK? Does it function properly or does it also not work for you?


                  Intriguing. Ok, then I'm lost. Because I have that code yet my controllers dont have separate input.

                  Also, when I run the multi-controller demo from July 2012 UDK, it doesn't restrict the focus on each panel. My single mouse that I have connected is able to access both panels. Also, when running through flash, it does not detect any input from USB Xbox Controllers; but I know that's just a flash thing.

                  Any new direction or advice would be greatly appreciated.

                  Thank You So Much,


                    When I run the demo, the mouse can only access the Controller 0 tab. What version of the Scaleform player are you running this in? It should say at the top of the window.

                    I have tried it in both 4.0.16, and 4.1.19 - and both work for me.

                    Are you running the SWF from the folder in our player? Or running the SWF by publishing it in Flash?


                      Hey Matt,

                      Yeah, that was my fault. I was running the published version and that was not working. When I run it with the Scaleform Launcher in Flash (which is version 4.0.15), it restricts the controller correctly. However, I cannot test with the Xbox controllers for that demo.

                      Then for my file, I can test with the Xbox controllers, but again, both physical controllers control the same input within the menu.

                      Thank You,


                        Also, I get this error when I launch the multiple controller demo:

                        Error: TypeError: Error #1006: getControllerMaskByFocusGroup is not a function.
                        at set scaleform.clik.core::UIComponent/focused()
                        at scaleform.clik.core::UIComponent/configUI()
                        at scaleform.clik.core::UIComponent/valiudateNow()


                          As an update:

                          I added the Scaleform Player from the July 2012 Build (version 4.0.16) and used that to launch my menu. There was no change in terms of separate input per controller.


                            Yeah It seems like you are having some setup issues. I have an XBox 360 controller plugged into my PC here, and the demo works as epxected for me just fine with both the left analog stick and the left DPad. The error you get when launching seems to be the culprit. I suspect you have compiled the SWF yourself, and did not have your classpaths setup correctly to do so.

                            Have you setup your classpaths for AS3?

                            Also, have you disabled automatically declare stage instances in your AS3 settings for the file?

                            Also - for a fact, if you launch the demo in the standard Adobe Flash player it will NOT work. Controller won't even register, only mouse will. And the mouse will be able to use both sides. You must test in Scaleform player only.


                              Hey Matt,

                              Thanks for the quick replies.

                              The issue is finally fixed. My current project is using the March 2012 UDK Build. I forgot to change the AS 3.0 classpath inside of flash when I downloaded the July 2012 build. However, since my project is not going to change builds, would it be possible to simply copy the development files for flash from the July build to the March build and still have my file work?

                              Thanks so much for all the help. Sorry to have it be such a stupid error on my end.