Android: Add support for cursor icons
This commit is contained in:
parent
169268ae20
commit
f5b5e00a01
7 changed files with 110 additions and 4 deletions
|
|
@ -43,6 +43,7 @@ GodotJavaViewWrapper::GodotJavaViewWrapper(jobject godot_view) {
|
|||
if (android_get_device_api_level() >= __ANDROID_API_O__) {
|
||||
_request_pointer_capture = env->GetMethodID(_cls, "requestPointerCapture", "()V");
|
||||
_release_pointer_capture = env->GetMethodID(_cls, "releasePointerCapture", "()V");
|
||||
_set_pointer_icon = env->GetMethodID(_cls, "setPointerIcon", "(I)V");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -64,6 +65,15 @@ void GodotJavaViewWrapper::release_pointer_capture() {
|
|||
}
|
||||
}
|
||||
|
||||
void GodotJavaViewWrapper::set_pointer_icon(int pointer_type) {
|
||||
if (_set_pointer_icon != 0) {
|
||||
JNIEnv *env = get_jni_env();
|
||||
ERR_FAIL_COND(env == nullptr);
|
||||
|
||||
env->CallVoidMethod(_godot_view, _set_pointer_icon, pointer_type);
|
||||
}
|
||||
}
|
||||
|
||||
GodotJavaViewWrapper::~GodotJavaViewWrapper() {
|
||||
JNIEnv *env = get_jni_env();
|
||||
ERR_FAIL_COND(env == nullptr);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue