AS3/AIR: If phone use portrait, if tablet use landscape?

后端 未结 3 539
南方客
南方客 2021-01-15 23:02

Ok, I\'ve written myself a simple DeviceCapabilites class to be able to check if the device is a phone or tablet etc.

But I need to be able to say that if the user i

3条回答
  •  忘掉有多难
    2021-01-15 23:22

    Something like this?

    stage.autoOrients = false;
    
    if(YourDeviceCapsClass.isTablet)
        stage.setOrientation(StageOrientation.ROTATED_LEFT);
    else
        stage.setOrientation(StageOrientation.DEFAULT);
    

提交回复
热议问题