away3d and starling resizing issue

Software: Away3D 4.x

Matej, Jr. Member
Posted: 01 March 2013 04:36 PM   Total Posts: 38

I am having problems trying to resize correctly both away3d Gold, master branch and Starling in stage3d both working in a single game.

I have 4 starling instances and 1 Away3d instance handled by stage3dProxys.

This all work PERFECT on the initial size. Problems start when resizing the game in a browser.

The game .swf will be loaded by another parent .swf in the end, but when the game is loaded directly on it’s own HTML template the same thing happens.

What I have for now is:

stage.addEventListenerEvent.RESIZEonResizefalse0true );

    private function 
onResize(event:Event):void {
            _stage3DProxy
.width stage.stageWidth;
            
_stage3DProxy.height stage.stageHeight;
    
    
        

It is working for starling instances, but not for away 3d instance. AND it does not show the cutted images that should be outside the stage.

I also tried unsuccesfully:

 

starling.stage.stageWidth this.stage.stageWidth;
             
starling.stage.stageHeight this.stage.stageHeight;

             var 
viewPort:Rectangle RectangleUtil.fit(
                new 
Rectangle(00stage.stageWidthstage.stageHeight),
                new 
Rectangle(00stage.fullScreenWidthstage.fullScreenHeight),
            
ScaleMode.NO_BORDER);

         
Starling.current.viewPort viewPort

What I want to achieve is what you achieve in traditional Flash when setting the Size to “percentage”  the scale to:“NO_BORDER” and the align to: “Top Center” with a min height and width.

How to achieve this?

Thank you

Matej

   

geekay, Jr. Member
Posted: 04 March 2013 04:34 AM   Total Posts: 40   [ # 1 ]

I had a similar issue, but I went with StageScaleMode.NO_SCALE as a compromise and it seemed to work in my specific situation.

Try this and let me know if it helps; If not I can try to look into this a little bit more and see if I can help.

   
   
‹‹ 3D App

X

Away3D Forum

Member Login

Username

Password

Remember_me



X