我正在尝试从-desktop特定的类中设置一个应用程序图标:
package org.osgameseed.games.animalflip; import com.badlogic.gdx.Files; import com.badlogic.gdx.backends.lwjgl.LwjglApplication; import com.badlogic.gdx.backends.lwjgl.LwjglApplicationConfiguration; public class Main { public static void main(String[] args) { LwjglApplicationConfiguration cfg = new LwjglApplicationConfiguration(); cfg.title = "AnimalFlip"; cfg.useGL20 = false; cfg.width = 800; cfg.height = 600; cfg.addIcon("data/ic_launcher.png",Files.FileType.Internal); new LwjglApplication(new AnimalFlipGame(),cfg); } }
该图标未设置(至少在Linux上),有关如何设置的任何想法?
解决方法
看看api(addIcon(…)):
Adds a window icon. Icons are tried in the order added,the first one
that works is used. Typically three icons should be provided: 128×128
(for Mac),32×32 (for Windows and Linux),and 16×16 (for Windows).
也许你的图标的尺寸是错误的,所以它不会被设置.否则它应该工作!
只要提到你只需在左上边缘设置小图标(如果应用程序启动),它不是桌面上看到的图标!