[About macOS Sequoia] (Updated October 22, 2024)
Live2D Cubism Editor 5.1.02 now supports macOS Sequoia.
Other Live2D Cubism products currently released are not guaranteed to work on macOS Sequoia.
Please refrain from upgrading macOS, as it may not operate properly.
How to set an image as the background in the Live Wallpaper on Android?
The Live Wallpaper example working great but it's always has a very sad black background. I've tried to set the background the same way as sampleApp1 (using setupBackground(context)) but in GLWallpaperService it won't load the background resource. >.<
0 ·
Comments
Please try the following .
1) Copy from [sample/sampleApp1/src/jp/live2d/utils/android] to [liveWallpaper]
2) Copy from [sample/sampleApp1/src/jp/live2d/sample/LAppDefine.java] to [liveWallpaper]
3) Copy from [sample/sampleApp1/assets/image/back_class_normal.png] to [liveWallpaper]
4) Fixed LiveWallpaperService.java(Fixed Points Add the Comment "Add Code") 5) Fixed Live2DRenderer.java(Fixed Points Add the Comment "Add Code")
You can change the background image if change of BACK_IMAGE_NAME of LAppDefine.java .
I am sorry if I post the question here, I just thought it is related very closely.
Drawing point of the background is the following code .
Live2DRenderer.java - onDrawFrame() In other words , change the value of glTranslatef.
I don't know about the hit area .
I have never tried together with wallpaper .
Also... is there a way to reduce memory usage? seems that it's taking a lot of memory(ram?) quite huge . Is it because of *.mtn animation too long? or texture too much?
gl.glScalef(2.4f, 2.4f, 2.4f); // scale(x, y, z)
gl.glTranslatef(0.0f, -0.3f, 0.0f); // position(x, y, z)
gl.glOrthof(0 , modelWidth , modelWidth / aspect , 0 , 0.5f , -0.5f ) ;
to :
gl.glScalef(2.0f, 2.0f, 2.0f); // scale(x, y, z)
gl.glTranslatef(0.0f, -0.1f, 0.0f); // position(x, y, z)
gl.glOrthof(0 , modelWidth , modelWidth / aspect , 0 , 0.5f , -0.5f ) ;
Because it is the size and position of my model i tried returning it to your original code but still doesn't work (background doesn't move)
I am still tinkering though lol
on LiveWallpaperService.java
I added :
@Override public void onVisibilityChanged(boolean visible) { if (!visible) { renderer.motionMgr.stopAllMotions(); } else { renderer.motionMgr.startMotion(renderer.motion, false); } }
Seems to reduce the memory usage significantly on my device. (though this might not be entirely correct . . but it works)