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

Render to Texture and Mouse Input Capture

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

  • Render to Texture and Mouse Input Capture

    So, I've been experimenting with converting some fullscreen Scaleform content to render-to-texture on ingame items.
    I've been able to get keyboard input hooked without any problem, but I'm unable to get mouse input working. I saw a post on here from August '10 that had success using a dummy (empty) swf being loaded in fullscreen first, then the render to texture afterwards, but that doesnt work.
    In case it's relevant, my flash file imports ExternalInterface and i have gfxExtensions enabled. The mouse cursor is moved using startDrag, and in fullscreen this seems to work - is there some sort of caveat to this that would render it non-functional when the swf is projected?
    In case its something specifically wrong with my setup, I've uploaded a copy of a test level and package, which can be found here , if anybody feels like taking a look.

  • #2
    using cursor on a render to texture.

    hello twiddle87,
    i have also been playing around with this and failed to have any success. But i did have a mammoth idea which i never followed through on .. perhaps you can give it a try and let others know if it works out

    1/ You apply your swf to a render to texture, but this swf version has no cursor in it.
    2/ Use InterpActors in Matinee to goto the rough swf button positions, and for each page in your swf file.
    3/ Open another blank swf as a HUD, this one will contain the cursor.
    4/ Using mousepress events - trace from the cursor position on HUD to the hitlocation in 3Dspace.
    when your interpActor (which is placed infront of your swf button) is hit on this mouse event, you can
    invoke action script to tell your swf to go to other frames/menus etc. At the same time play a matinee
    which moves other InterpActors to the the new button positions and starting all over again etc etc.

    i was at one stage desperate to make this work, but i never went through with the idea. It seemed to me that i may as well just not use a swf at all,
    and there will be a code snippit somewhere to make the actual mouse cursors screen position correspond to the swfs position in 3d space.
    Until i can just click on a checkbox in Kismet to have cursor functionality...I really can't be bothered.

    i am currently working on a game where you can click to select players and clcik to select a move to location..based off of the source files from this guys website:
    Dr Bearhands. which is www.4r7w4re.com or artware if you cant understand it. this is where i get the hud trace idea from.

    let me know if any of this was any help to you.

    Comment


    • #3
      actually if your scaleform flash movie has clickeable buttons that work well on 2D they shoulld do the same on 3D aka using render to texture Just make sure its using the bTakeFocus,CaptureInput etc options in its defaultproperties

      Comment


      • #4
        yes you're right, after some tinkering it does work, however in kismet i open the first swf movie with its render target etc, and the cursor didnt move what so ever. that is until i disabled all its take focus, and Disabled capture input bools, followed by opening another movie with 'no render target' which has 'take focus and capture inputs' Enabled . So then when i move the mouse around within the HUD i can 'then' see the cursor moving around on the BSP with the render target.... ????

        is there some sort of special AS2 coordinate code im missing for cursor movement on BSP surfaces or???

        the movie works fine when it has no render target and is used as regular HUD, but not when it has a render to texture..
        the AS2 code i use to move the cursor is stored in the first frame in an actions layer etc:

        var mycursor:Object = new Object();
        mycursor = cursor;
        onMouseMove = function(){
        mycursor._x = _root._xmouse;
        mycursor._y = _root._ymouse;
        }
        ive also used the startDrag code but that made no difference either. What am i doing wrong here?

        Comment


        • #5
          SWF on object - cursor

          Here is a related issue -- the SWF on the object does work, but the cursor thinks it is somewhere else, probably from 0,0 on the screen ... well, I think something like that until told otherwise.

          http://youtu.be/wg9n-gRg6vo

          Comment


          • #6
            I still have problem with mouse-click when I render my swf on texture!
            My mouse follow my movement ( without any trick such as dummy swf) but mc.onPress = function() {} never is called at all !

            In face I did all things in code and everything works fine when I comment this mad line :
            RenderTexture=TextureRenderTarget2D'textureRender_ EA.Text';

            here is my GFxMoviePlyer code :

            Code:
            class SHPauseMenu extends GFxMoviePlayer;
            
            var ShHUDWrapper myHudWrapper;
            var GFxObject PauseMC;
            
            
            function bool Start(optional bool StartPaused = false) // wrote as UT/GFxUI_PauseMenu.uc 
            {
            	RenderTexture=TextureRenderTarget2D'textureRender_EA.Text';
            	super.Start();
            	Advance(0);
            	PauseMC=none;
            	PauseMC = GetVariableObject("_root.pause");
            	return true;
            }
            
            function PlayOpenAnimation()
            {
            	PauseMC.GotoAndPlayI(1);
            }
            
            
            function resume_bt()
            {
            	`log("HUD::resume_bt");
            }
            
            	
            DefaultProperties
            {
            	MovieInfo=SwfMovie'Shabgard_GUI_PC.ShabgardPauseMenu'
            	SoundThemes(0)=(ThemeName=default ,Theme=UISoundTheme'Shabgard_GUI_PC.MouseOverSound')
            	RenderTextureMode=RTM_AlphaComposite
            
            	bTakeFocus=true;
            	bIgnoreMouseInput=false
            	bPauseGameWhileActive=false
            	bCaptureInput=true
            }

            Comment


            • #7
              Its a very well known problem and from what i have seen from both Epic games and the scaleform support it seems they dont care about the issue right now

              Comment


              • #8
                purging
                your message to at least 10 characters.

                Comment


                • #9
                  i have reported the issue various times to epic / scaleform staff and yet no replies So you are better of writting most of the input yourself from scratch

                  Comment


                  • #10
                    purging
                    your message to at least 10 characters.

                    Comment


                    • #11
                      i use alot of "self" to invoke the intellisense from nfringe
                      You shouldn't actually, US's self keyword isn't exactly the same as This, Self or Me in other languages. You should use self whenever necessary, which is two cases actually, either when you wanna send a reference to this object as an argument to a function, or, to assign a reference of this object to another class's variable.

                      That being said, you really shouldn't need it for that if nFringe is anything like what it was before. I haven't used nFringe in a long time, but at the time you could bring up the intellisense by pressing ctrl+space.

                      If for any reason that won't work, then you should do a find in your code for "self." every time you've done some coding, and remove them all.

                      Comment

                      Working...
                      X