Announcement

Collapse
No announcement yet.

OnResize visibleRect

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

    OnResize visibleRect

    I have my gfx hud working for a specific size (1280x720) for both the swf file and the udk instance; however I can't get the resizing to work correctly. When I resize, my mouse coordinates start to do funky stuff, and then the deproject doesn't work right to translate between 2D and 3D coordinates.
    I am building from the example udk_hud, but with my assets. I am pretty sure the problem could be solved by using the stage listener to get onResize event. However when I try to build any version of the udk_hud.fla examples, I get a compiler error: "There is no property with the name 'visibleRect'." Yes, the Stage object does not have a visibleRect property. Do I need to import something in order to extend the functionality of the Stage object? Any other thoughts? I feel like I must be missing a simple setting or something.

    #2
    It looks like the visibleRect is an extension to the Stage object through gfx. I am not sure if there is a way to debug with gfx extensions in flash, as I am using the scaleform launcher, but the compiler errors still come up.

    In any case, I was able to use the code from Matt Doyle's post here.
    But I had to explicity add a call to the setHudResolution function, as when the game starts up there is no onResize call. Then the height difference (heighDiff is half the height difference) and width difference are calculated.

    Then I added(subtracted actually) these values to the mouse cursor code by Kitese here. So the code for the onMouseMove function looks like this:
    Code:
    mouseListener.onMouseMove = function ()
    {
    	// Tell our UnrealScript about the new mouse coords.
    	ExternalInterface.call( "ReceiveMouseCoords", _root._xmouse-widthDiff, _root._ymouse-heightDiff );
    	updateAfterEvent();
    };

    Comment


      #3
      Were you sure to include:

      _global.gfxExtensions = true;

      at the top of your ActionScript to use GFx extensions.

      Comment


        #4
        I've had the same problem, but I've fixed it by setting up Scaleform GFX as per these instructions (I had only set it up for AS3 and I was trying to use it for AS2 now). Then I did what Matt Doyle has suggested above and added _global.gfxExtensions = true; at the top of the Actionscript code. Error gone.

        Comment


          #5
          _global is not supported in as3. so what it should be ,for example "_global.imecommand".

          Comment

          Working...
          X