Engine Class¶
initialize¶
Initializes EasyAR. EasyAR must be initialized before other functions start to work.
(until 2.0.0) This function is used in Windows, Mac and iOS. For Android, you should use java method engine.EasyAR.initialize.
(since 2.1.0) Java Only This method will automatically load EasyAR native libraries. If you desire more advanced control for native library loading, use initializeWithoutSoLibraryLoad instead.
- C: bool easyar_Engine_initialize(easyar_String * key)¶
- C++11: static bool initialize(std::string key)¶
- Traditional C++: static bool initialize(String * key)¶
- Java (until EasyAR SDK 2.1.0): public static native boolean initialize(java.lang.String key)¶
- Objective-C: + (bool)initialize:(NSString *)key¶
- Swift (since EasyAR SDK 2.1.0): public static func initialize(_ key: String) -> Bool¶
- Java (since EasyAR SDK 2.1.0): public static boolean initialize(Activity activity, String key, String soLibraryDir)¶
- Java (since EasyAR SDK 2.1.0): public static boolean initialize(Activity activity, String key)¶
onPause¶
Handles the app onPause, pauses internal tasks.
(until 2.0.0) This function is used in Windows, Mac and iOS. For Android, you should use java method engine.EasyAR.onPause.
(since 2.1.0) Java Only Behaviour has changed in 2.1.0, suggest to use this method.
- C: void easyar_Engine_onPause()¶
- C++11: static void onPause()¶
- Traditional C++: static void onPause()¶
- Java: public static native void onPause()¶
- Objective-C: + (void)onPause¶
- Swift (since EasyAR SDK 2.1.0): public static func onPause() -> Void¶
onResume¶
Handles the app onResume, resumes internal tasks.
(until 2.0.0) This function is used in Windows, Mac and iOS. For Android, you should use java method engine.EasyAR.onResume.
(since 2.1.0) Java Only Behaviour has changed in 2.1.0, suggest to use this method.
- C: void easyar_Engine_onResume()¶
- C++11: static void onResume()¶
- Traditional C++: static void onResume()¶
- Java: public static native void onResume()¶
- Objective-C: + (void)onResume¶
- Swift (since EasyAR SDK 2.1.0): public static func onResume() -> Void¶
setRotation¶
Sets screen rotation.
Orientation input |
value |
---|---|
UIInterfaceOrientationPortrait |
270 |
UIInterfaceOrientationPortraitUpsideDown |
90 |
UIInterfaceOrientationLandscapeLeft |
180 |
UIInterfaceOrientationLandscapeRight |
0 |
- C: void easyar_Engine_setRotation(int rotation)¶
- C++11: static void setRotation(int rotation)¶
- Traditional C++: static void setRotation(int rotation)¶
- Java: public static native void setRotation(int rotation)¶
- Objective-C: + (void)setRotation:(int)rotation¶
- Swift (since EasyAR SDK 2.1.0): public static func setRotation(_ rotation: Int32) -> Void¶
versionString¶
Returns EasyAR version string.
- C: void easyar_Engine_versionString(easyar_String * * Return)¶
- C++11: static std::string versionString()¶
- Traditional C++: static void versionString(String * * Return)¶
- Java: public static native java.lang.String versionString()¶
- Objective-C: + (NSString *)versionString¶
- Swift (since EasyAR SDK 2.1.0): public static func versionString() -> String¶
name¶
Returns product name.
- C: void easyar_Engine_name(easyar_String * * Return)¶
- C++11: static std::string name()¶
- Traditional C++: static void name(String * * Return)¶
- Java: public static native java.lang.String name()¶
- Objective-C: + (NSString *)name¶
- Swift (since EasyAR SDK 2.1.0): public static func name() -> String¶
initializeWithoutSoLibraryLoad¶
(since 2.1.0) Java Only
Initializes EasyAR. EasyAR must be initialized before other functions start to work.
This method will not load EasyAR native libraries, make sure to load libraries by your own or using loadLibraries.
- Java (since EasyAR SDK 2.1.0): public static boolean initializeWithoutSoLibraryLoad(Activity activity, String key)¶
setInternalRotateHandling¶
(since 2.1.0) Java Only
Enable/Disable the internal rotation handler. This is usefull when the default handler do not work as expected.
- Java (since EasyAR SDK 2.1.0): public static void setInternalRotateHandling(boolean enable)¶
loadLibraries¶
(since 2.1.0) Java Only
Load native libraries, use only if you are using initializeWithoutSoLibraryLoad to initialize EasyAR.
- Java (since EasyAR SDK 2.1.0): public static void loadLibraries()¶
- Java (since EasyAR SDK 2.1.0): public static void loadLibraries(String soLibraryDir)¶