Comments (8)
Targeting flash an error occurs:
Assets.hx: 180[openfl.Assets] There is no BitmapData asset with ID of "assets/nme.png"
I tried to add an "assets" tag in the xml but still no luck.
from openfl.
Sorry.
I got it working by adding
< assets path="Assets" rename="assets" exclude="nme.svg" />
as in the old NME example (I was missing the "rename").
It may be worth mentioning, in the "Transition-to-OpenFL" page, that you need an "assets" tag?
Cheers :D
from openfl.
When someone embedded an asset using NME, they would use an tag and they would use nme.Assets
Now with embedded @:bitmap tag (and others) you can directly embed assets, avoiding the openfl.Assets class and accompanying tag ... its up to your preference :)
from openfl.
@jgranick Will openfl.Assets class stay in openfl or it will be removed after some time?
from openfl.
Joshua, thank you very much for your patience. This leads me to my next question: http://www.nme.io/index.php?cID=11557
Cheers
from openfl.
Hi there,
So I was having a problem where Assets.getBitmapData ("assets/nme.png"); is returning null.
Turns out that I need to import and use "nme.Assets" instead of "openfl.Assets". After I did that, getBitmapData started working.
Shouldn't openfl be independent from NME?
Thanks, guys!
from openfl.
I found this thread when trying to figure this out, and thought I would post what I did incase it could help anyone.
in my project.xml:
<assets path="assets/include" include="*" />
then in your Main.hx: import openfl.Assets;
then
new Bitmap(openfl.Assets.getBitmapData('assets/include/myGreatAsset.png'));
from openfl.
I fell in the same trap. Perhaps the error message could be more noob friendly by stating "... Please check your project.xml"
from openfl.
Related Issues (20)
- Sounds over a certain length do not play properly. HOT 3
- Text Field fails to render certain Unicode characters HOT 6
- [html5] FileReferenceList doesn't dispatch Event.CANCEL HOT 1
- DropShadowFilter renders incorrectly when applied onto a TextField HOT 1
- OpenFL is compatible with old devices on WeChat IOS, which can cause`__scissorRectangle` An error occurred during off screen rendering;
- FlashPlayer does not change its size HOT 4
- [HTML5] Display looks bad when it is not a scale HOT 1
- Custom fonts don't support bold or italic variants on Windows HOT 3
- Uncaught TypeError: Cannot read properties of null (reading 'duration') - Sound.hx:761
- TextField does not handle <img> on platforms other than Flash HOT 3
- The Hashlink profiler does not work with OpenFL HOT 5
- Linking to `utest` or `munit` breaks HTML5 target HOT 1
- how do i use the core opengl core profile on macOS haxe? HOT 5
- Support for uniform structures in GLSL
- WebSocket APIs
- preserveDrawingBuffer attribute support.
- iOS Runpath issue
- Holding down keyboard keys on MacOS brings up special character menu HOT 5
- Threading with bitmap datas converted to textures silent crashes the game HOT 2
- Setting bitmap smoothing to false still results in smoothed bitmaps
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from openfl.