Code Monkey home page Code Monkey logo

Comments (8)

madrazoman avatar madrazoman commented on May 20, 2024

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.

madrazoman avatar madrazoman commented on May 20, 2024

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.

jgranick avatar jgranick commented on May 20, 2024

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.

Beeblerox avatar Beeblerox commented on May 20, 2024

@jgranick Will openfl.Assets class stay in openfl or it will be removed after some time?

from openfl.

madrazoman avatar madrazoman commented on May 20, 2024

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.

accidentalrebel avatar accidentalrebel commented on May 20, 2024

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.

prettymuchbryce avatar prettymuchbryce commented on May 20, 2024

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.

dagnelies avatar dagnelies commented on May 20, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.