Copy link to clipboard
Copied
How to rotate the screen in simulator in adobe flash builder, its work in my samsung s6 edge+ , but it's not work simulator in flash builder
my code :
import as3isolib.geom.Pt;
import eDpLib.events.ProxyEvent;
import flash.display.Sprite;
import flash.events.Event;
import flash.events.MouseEvent;
import flash.display.Sprite;
import flash.display.StageAlign;
import flash.display.StageScaleMode;
[SWF(backgroundColor = '#000000' , framerate = '30')]
public class map extends Sprite
{
private var grid : IsoGrid;
private var scene:IsoScene;
private var view:IsoView;
private static const CELL_SIZE:Number = 40 ;
private var box:IsoBox;
public static const StageAspectRatio:String = "portrait";
public static const LANDSCAPE:String = "landscape"
public function map()
{
super();
//stage.align = StageAlign.TOP_RIGHT;
stage.setAspectRatio(LANDSCAPE );
stage.autoOrients = false ;
stage.setOrientation( "rotatedRight" );
//stage.scaleMode = StageScaleMode.SHOW_ALL;
grid = new IsoGrid();
// grid.addEventListener(MouseEvent.CLICK , gridClick );
grid.addEventListener(MouseEvent.MOUSE_MOVE , gridClick );
grid.setGridSize(15 , 15, 1 );
grid.cellSize = CELL_SIZE ;
grid.showOrigin = false ;
box = new IsoBox();
box.setSize(CELL_SIZE , CELL_SIZE , CELL_SIZE );
scene = new IsoScene();
scene.addChild(grid);
scene.addChild(box);
scene.render();
view = new IsoView();
view.setSize( stage.fullScreenWidth , stage.fullScreenHeight);
view.addScene(scene);
view.centerOnPt( new Pt( 200 , 200 , 0 ) );
addChild(view);
}
protected function gridClick(event:ProxyEvent😞void
{
var me : MouseEvent = MouseEvent( event.targetEvent );
var p : Pt = new Pt( me.localX , me.localY );
IsoMath.screenToIso(p);
box.moveTo(Math.floor(p.x/CELL_SIZE)*CELL_SIZE,Math.floor(p.y/CELL_SIZE)*CELL_SIZE , 0);
scene.render();
}
}
}
its look like this ....
And also the Orientation in my Samsung s6 edge+ its not good because there are black area in the top and the button