Announcement

Collapse

The Infinity Blade Forums Have Moved

We've launched brand new Infinity Blade forums with improved features and revamped layout. We've also included a complete archive of the previous posts. Come check out the new Infinity Blade forums.
See more
See less

Dropdown List Layers Issue

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

    Dropdown List Layers Issue

    For some reason I'm having an issue with layer ordering when using drop-down lists.

    The issue is that it scaleform always puts the itemRenderers are on top of everything else including my mouse cursor. Any ideas? It doesn't happen on scrolling lists or button bars.

    #2
    Separate Mouse Cursor SWF and Other UI SWF
    then Init Mouse Cursor SWF after Other SWF
    sample:
    Code:
    	if (HudUI == None)
    	{
    		HudUI  = new class'DefendMaster.UISWF';
    		HudUI.Init();
    	}
    	
    	if (HudMouse== None)
    	{
    		HudMouse= new class'DefendMaster.MouseSWF';
    		HudMouse.Init();
    	}
    or

    Use HUD DrawTile for Mouse Cursor



    Comment


      #3
      Great idea thanks. That should do it.

      Comment


        #4
        Another possibility, if your mouse is in the same Flash file (the HUD), is to use this UnrealScript:

        ...assuming your mouse cursor movie clip has been cached at MouseCursor...

        Code:
        MouseCursor.SetBool("topmostLevel", true); // This ensures the mouse is drawn at the top most level, above all other UI widgets.
        Using this method, it is best to place all your UI content (with the exception of the mouse cursor) inside a container movie clip that lives at _root. This will ensure the mouse is always on top, even when a popup (such as that found in a drop down menu widget), which normally sets itself above everything is created dynamically at runtime. Without the container movie clip, the popup widget would still appear above the mouse cursor.

        Comment


          #5
          Thanks a bunch Matt. That helps.

          Comment


            #6
            Hi there! I have the same problem and tried out your solution Matt. Now I have a cursor which is visible when I open a dropdrownmenu component but it vanishes when I move the cursor out of the component area when the list is open. After selecting an index the cursor is visible again. Is there also a way to fix this behaviour?

            Comment


              #7
              How do you go about caching the mouse cursor? I tried:

              Code:
              class SWMoviePlayer extends GFxMoviePlayer;
              
              var GFxObject cursor;
              
              event bool Start(optional bool StartPaused = false)
              {
                  super.Start();
                  Advance(0);
                  cursor = new class'GFxObject';
                  cursor = GetObject("cursor"); //instance name of cursor in flash
                  cursor.SetBool("topmostLevel", true); // This ensures the mouse is drawn at the top most level, above all other UI widgets.
                  return true;
              }
              But this line:

              Code:
              cursor = GetObject("cursor");
              throws "Bad or missing expression for token: GetObject, in '='". I would really appreciate some help on this. I've tried solutions from other threads but none have worked for me.

              Comment


                #8
                Originally posted by slowJusko View Post
                I would suggest this thread : [SOLVED] DropDownList Popup Layering Issue (AS3)
                Using the setTopmostLevel() option worked for me.
                Copy'n'paste from other similar thread

                Comment


                  #9
                  Try this:

                  Code:
                  cursor = GetObject("_root.cursor");

                  Comment


                    #10
                    Oops, wasn't subscribed to this thread so I didn't know anyone replied. slowJusko I tried that solution a while ago and even though I could compile the actionscript without errors it just wouldn't work. I've tried so many things. I finally got the unrealscript to compile by looking at the UDKFrontEnd scripts. I believe I had to use GetVariableObject instead of GetObject. Here is what I have right now:

                    I have my main menu in its own movie clip which holds the dropdown list. My cursor movie clip is not part of the main menu and it is on its own layer above the main menu. My unrealscript looks like this:

                    Code:
                    class SWMoviePlayer extends GFxMoviePlayer;
                    
                    var GFxObject CursorMC;
                    
                    //function to receive External Interface call
                    function bool Start(optional bool StartPaused = false)
                    {
                        super.Start();
                        Advance(0);
                    
                        CursorMC = GetVariableObject("_root.cursor_mc");
                        CursorMC.SetBool("topmostLevel", true); // This ensures the mouse is drawn at the top most level, above all other UI widgets.
                    
                        return true;
                    }
                    I have also tried:

                    Code:
                    class SWMoviePlayer extends GFxMoviePlayer;
                    
                    var GFxObject TitleScreenMC;
                    var GFxObject CursorMC;
                    
                    //function to receive External Interface call
                    function bool Start(optional bool StartPaused = false)
                    {
                        super.Start();
                        Advance(0);
                    
                        TitleScreenMC = GetVariableObject("_root");
                        CursorMC = TitleScreenMC.GetObject("cursor_mc");
                        CursorMC.SetBool("topmostLevel", true); // This ensures the mouse is drawn at the top most level, above all other UI widgets.
                    
                        return true;
                    }
                    Both compile without errors, but don't solve the problem of the mouse getting drawn behind the dropdown list. cursor_mc is indeed the instance name of my custom cursor in the .fla file. I am reimporting the .swf into UDK everytime it is changed. I just don't know. It's probably something incredibly stupid. For the sake of completion here is my actionscript:

                    Code:
                    import scaleform.gfx.Extensions;
                    import scaleform.gfx.InteractiveObjectEx;
                    import flash.display.MovieClip;
                    import flash.external.ExternalInterface;
                    //import flash.display.InteractiveObject;
                    
                    scaleform.gfx.Extensions.enabled = true;
                    //scaleform.gfx.InteractiveObjectEx.enabled = true;
                    
                    //var ioex:InteractiveObjectEx = new InteractiveObjectEx();
                    
                    function OpenOptionsMenu(e:MouseEvent):void {
                    	gotoAndPlay("optionsMenu");
                    }
                    function PlayGame(e:MouseEvent):void {
                        ExternalInterface.call("LoadMap");
                    }
                    function ExitGame(e:MouseEvent):void {
                        ExternalInterface.call("ExitGame");
                    }
                    function mouseLeaveHandler(evt:Event):void
                    {
                    	cursor_mc.visible = false;
                    }
                    function handleMouseMove( e:MouseEvent ):void 
                    {
                    	cursor_mc.visible = true;
                    	cursor_mc.x = stage.mouseX;
                    	cursor_mc.y = stage.mouseY;
                    	//InteractiveObjectEx.setTopmostLevel(cursor_mc, true);
                    	//InteractiveObjectEx.setHitTestDisable(cursor_mc, true);
                    }
                    
                    MainMenuMC.optionsBtn.addEventListener(MouseEvent.CLICK, OpenOptionsMenu);
                    MainMenuMC.playBtn.addEventListener(MouseEvent.CLICK, PlayGame);
                    MainMenuMC.exitBtn.addEventListener(MouseEvent.CLICK, ExitGame);
                    stage.addEventListener(Event.MOUSE_LEAVE, mouseLeaveHandler);
                    stage.addEventListener( MouseEvent.MOUSE_MOVE, handleMouseMove, false, 0, true );
                    
                    Mouse.hide();
                    var cursor_mc:MovieClip;
                    cursor_mc.mouseEnabled = false;
                    cursor_mc.tabEnabled = false;
                    //cursor_mc.visible = false;
                    
                    stop();

                    Comment

                    Working...
                    X