- Download Android Studio.
- Create a trash empty Android project and note where it is stored on your computer.
- You NEED to do this or else the option for Image Asset Studio will not show up.
- Create your icon using Image Asset Studio and save.
- https://developer.android.com/studio/write/image-asset-studio
- Unfortunately, it doesn’t look like GMS2 supports the background color option nor the round icon options. There doesn’t seem to be a good plug for the generated xml file in GMS2’s .yy file for the Android options. Eventually, I will get to how to get around the background color problem in this post; however, unfortunately, I don’t know if there’s a workaround to the round icons.
- Close Android Studio and navigate to your Android project folder and look for that res folder with all your .png files.
- Right now, the path is \app\src\main\res.
- You could just search .png.
- Open GMS2 and go to your Android Game Options.
- Right now, I find it in the Quick Access Panel in the Asset Browser.
- STRANGELY, this is different than the “Game Options” available from the three bars in the top right of the Asset Browser, so be sure to use the correct one.
- Right now, I find it in the Quick Access Panel in the Asset Browser.
- In the Adaptive Icons’ section, generate some “trash” icons.
- If you would like a background color, this is where you can generate it.
- Open up Paint (or whatever image creation program you have that makes a .png) and create a image of the background color you want.
- The size of this color “swatch” doesn’t matter, as long as it fills the whole image (i.e. use the bucket tool).
- Use this swatch as your background source image when generating your “trash” adaptive icons.
- Open up Paint (or whatever image creation program you have that makes a .png) and create a image of the background color you want.
- https://docs2.yoyogames.com/source/_build/2_interface/3_settings/game_options/options_android.html.
- If you would like a background color, this is where you can generate it.
- Open your GMS2 project folder and navigate to the Android options.
- Right now, they are at \options\android.
- In GMS2, there are three folders for your Android icons:
- icons
- Non-adaptive icons required for devices that don’t support Adaptive Icons (i.e. older than Android Oreo = 8.0 = API level 26).
- icons_adaptive
- FOREGROUND images for adaptive icons.
- icons_adaptivebg
- BACKGROUND images for adaptive icons.
- If you generated from a color swatch, you can see the result here.
- icons
- Now, you need to go around REPLACING all the images in GMS2 with all the respective images in the trash Android project.
- Images can be matched by hovering over the image and checking the image’s pixel-by-pixel size.
- Make sure you keep the naming scheme of GMS2.
- Right now, here are some example mappings from Android to GMS2.
- mipmap-hdpi\ic_launcher.png ==> icons\hdpi.png
- mipmap-hdpi\ic_launcher_foreground.png ==> icons_adaptive\hdpi.png
- You will notice that the Android Studio Image Asset Studio does NOT produce the ldpi size.
- To generate an ldpi size, make a copy of your xxxhdpi image and resize it in Photos (or your image editing program) to the ldpi size.
- To determine the ldpi size, just look at the size of the GMS2 generated file.
- Now for EACH of the THREE GMS2 icons folders, you can xxxhdpi-copy, resize, replace the GMS2-generated ldpi.
- You MAY not want to use the Android Image Asset Studio generated images for the lower resolution non-adaptive icons, because your final centered image might be too small.
- In this case, just choose whatever image you would have used as the adaptive foreground or whatever new image you want and resize it appropriately.
- If you don’t want a flat square icon, make sure you use transparency for the unused part of your icon canvas.
- RELOAD GMS2 and you can preview the new icons in the Android Game Options Adaptive Icons section.
- Do NOT click “Generate”. Otherwise, all your hard work in replacing all your images will be overwritten.
- Compile and test!
- Close your Image editor, Android project folder, and GMS2 project folders so you don’t run into file-access conflicts (i.e. errors) during compilation.
- Test in emulator before Android Oreo for testing non-adaptive icons.
- Test in emulator at or after Android Oreo for testing adaptive icons.
- Test on a REAL DEVICE if you have the chance!