
编辑:
所以,假设我的核心项目中有一个界面:
public interface Opengallery {public voID opengallery();} 在我的androID目录中,我创建了一个特定于Platform的类来启动intent
import androID.content.Intent;import com.kubas.zaIDimas.Opengallery;public class galleryOpener extends AndroIDLauncher implements Opengallery { private static final int SELECT_PICTURE = 1; @OverrIDe public voID opengallery() { Intent intent = new Intent(); intent.setType("image/*"); intent.setAction(Intent.ACTION_GET_CONTENT); startActivityForResult(Intent.createChooser(intent,"Select Picture"),SELECT_PICTURE); } 从这一点起我该怎么办?所以我可以在我的主菜单中调用它?
解决方法 我创建了一个示例libgdx项目,其中包含特定于androID的代码,用于调用库并检索用户选择的图像的文件路径.希望这有助于您了解集成的工作原理.我在几个AndroID设备上测试过它.见 https://github.com/miket-ap/libgdx-platform-specific-example 总结
以上是内存溢出为你收集整理的android – 如何让用户从库中选择要在游戏中使用的图片,LibGDX全部内容,希望文章能够帮你解决android – 如何让用户从库中选择要在游戏中使用的图片,LibGDX所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)