Skip to content
This repository was archived by the owner on Apr 21, 2026. It is now read-only.

Latest commit

 

History

History
37 lines (24 loc) · 889 Bytes

File metadata and controls

37 lines (24 loc) · 889 Bytes

android-orientation

Haxe extension to set screen orientation in Android apps.

Installation

haxelib git android-orientation https://github.com/danielpancake/android-orientation.git

Precompiled libraries are included, but it is recommended you compile them yourself:

lime rebuild android-orientation android

Usage

  • In Project.xml:
<!-- Add this line in the libraries section of your Project.xml file -->
<haxelib name="android-orientation" />
  • In any Haxe package of your project:
import extension.androidorientation.AndroidOrientation;

...

AndroidOrientation.setScreenOrientation(AndroidOrientation.SENSOR_LANDSCAPE);
// or UNSPECIFIED, PORTRAIT, REVERSE_PORTRAIT, SENSOR_PORTRAIT, LANDSCAPE, REVERSE_LANDSCAPE

It is advised to call this function as early as possible (preferably in preloader) to avoid screen cropping.