StarlingGraphics / Starling-Extension-Graphics

flash.display.Graphics style extension for the Starling Flash GPU rendering framework
https://github.com/StarlingGraphics/Starling-Extension-Graphics/wiki
MIT License
285 stars 88 forks source link

SWF metadata tag mobile #23

Closed ericsala closed 11 years ago

ericsala commented 11 years ago

If I don't set SWF metadata tag [SWF( width="480", height="800", backgroundColor="#FFFFFF", frameRate="60" )]

I cannot draw under y = 600.

If I set metadata I can't configure multiresolution for diferent devices.

Any solution?

jonathanrpace commented 11 years ago

Could you try rendering some standard Starling content (like a quad or something) and see if that also gets clipped?

ericsala commented 11 years ago

The clipped content is only this.

var elastic:Shape = elastic.graphics.clear(); elastic.graphics.lineStyle(2, 0x000000); elastic.graphics.moveTo(150, screen_height-80); elastic.graphics.lineTo(screen_width-150, screen_height-80);

All the other content created throw Starling have no problems.

jonathanrpace commented 11 years ago

Thanks for the example code - I'll take a look tonight and see if I can see what's going wrong.

jonathanrpace commented 11 years ago

I wasn't able to reproduce your problem exactly. All starling content was getting clipped for me. However, I noticed that starling doesn't automatically re-scale it's Stage3D viewport when the stage size is changed. It's a little bit fiddly, but this seems to be the most reliable way of doing it.

    public function Main() 
    {
        stage.scaleMode = StageScaleMode.NO_SCALE;
        stage.align = StageAlign.TOP_LEFT;

        starlingInstance = new Starling( SomeApp, stage );

        stage.addEventListener(Event.RESIZE, onStageResize);
    }

    private function onStageResize(event:Event):void
    {
        starlingInstance.viewPort = new Rectangle(0,0,stage.stageWidth,stage.stageHeight);
        starlingInstance.stage.stageWidth = stage.stageWidth;
        starlingInstance.stage.stageHeight = stage.stageHeight;
    }

Let me know if that solves it for you.

jonathanrpace commented 11 years ago

Any luck with this?

ericsala commented 11 years ago

No, but I think the problem is in Starling. But only with Mobile.