放在哪里绘制资源为OpenFL Android的延伸? [英] Where to put drawable resources for an OpenFL android extension?

查看:202
本文介绍了放在哪里绘制资源为OpenFL Android的延伸?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想提出一个Android延长我的OpenFL应用程序,这是为了显示一个通知,当我调用一个函数从HAXE。

I am making an android extension for my OpenFL app, which is supposed to show a notification, when I call a function from Haxe.

我需要把绘制图标在我的扩建工程,由于通知要求的图标。

I need to put a drawable icon in my extension project, because a notification requires an icon.

不过,Java文件扩展了一个拓级,它提供了对象 - Extension.assetManager(android.content.res.AssetManager)

However, the Java file extends an "Extension" class, which provides the object - Extension.assetManager (android.content.res.AssetManager)

我如何使用它来访问一个可绘制类似R.drawable ....?

How do I use this to access a drawable similar to R.drawable....?

和还往哪里放绘图资源为OpenFL Android的扩展?

And also where to put drawable resources for the OpenFL android extension?

推荐答案

它看起来像<一个href=\"https://developer.android.com/reference/android/content/res/AssetManager.html#open%28java.lang.String%29\"相对=nofollow> AssetManager 可以访问文件中的资产的文件夹,所以我怀疑你需要做的是在扩建工程的根目录中创建该文件夹。要打开这个文件,你会使用这样的:

It looks like AssetManager can access files in the "assets" folder, so I suspect what you need to do is create this folder in the root of the extension project. To open the file, you'd use something like this:

Bitmap bitmap = BitmapFactory.decodeStream(AssetManager.open("filename.png"));

这篇关于放在哪里绘制资源为OpenFL Android的延伸?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆