-
In Cocos2dx, I used the following code to set a user default value in Java I tried the following: Appreciate any pointers. Thank you! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 5 replies
-
That isn't supported with the current implementation of UserDefault in Axmol, since it is no longer using the Android SharedPreferences implementation. You have several options (all very simple to do), such as: 1 - Implement your own UserDefault which would call the AxmolEngine functions for SharedPreferences, then call 2 - Add Java code to your application that can call native code in your app, and that in turn will call the current Axmol UserDefault implementation instead, so no need to use Android SharedPreferences etc.. For iOS, it's the same as Android, and you can implement both options, but, unless you specifically need the native key/value storage provided by the iOS/Android, then it may be easier to just go with option 2 for both (on iOS you would add the Objective-C code to call the UserDefault methods). |
Beta Was this translation helpful? Give feedback.
-
You can use |
Beta Was this translation helpful? Give feedback.
That isn't supported with the current implementation of UserDefault in Axmol, since it is no longer using the Android SharedPreferences implementation.
You have several options (all very simple to do), such as:
1 - Implement your own UserDefault which would call the AxmolEngine functions for SharedPreferences, then call
UserDefault::setDelegate(UserDefault* delegate)
to set your own implementation. You would add this custom UserDefault code to your own project.2 - Add Java code to your application that can call native code in your app, and that in turn will call the current Axmol UserDefault implementation instead, so no need to use Android SharedPreferences etc..
For iOS, it's the same …