GithubHelp home page GithubHelp logo

Minify to single file about animate HOT 7 CLOSED

pixijs avatar pixijs commented on May 6, 2024
Minify to single file

from animate.

Comments (7)

bigtimebuddy avatar bigtimebuddy commented on May 6, 2024

This is more of an extension issue. But could you clarify: are you asking to have the graphics draw commands be inline rather than in an external file?

The reason I set it up this way was because I wanted to make the output more modifiable/readable. Mixing in the graphic draws makes the output much more noisy... this is how the CreateJS output works and I never really liked it. The current setup treats vector graphics very similar to Textures and Spritesheets.

Could you describe your use-case more? What advantage would this have?

from animate.

nthapaliya avatar nthapaliya commented on May 6, 2024

Thanks, I should have started with my use case. We're learning about pixi-animate and the extension and so I understand we might not be using it correctly.

We're porting a flash app to html5 with pixi. We're trying to keep the look and feel of the new app close to the original flash app. We have a few simple static assets such as buttons, icons, etc that we want to use as close to 'vector' like as possible, ie we want to be able to scale and resize them easily without the blurriness that comes from rasterizing. Currently we export them to a png sprite sheet with multiple sizes for various zoom levels, but we're evaluating if we can make them sharper (and reduce download size to the client) by exporting them as pixi graphics objects that it draws on the fly.

My use case is this: The app is written in React, so we want the output to be consumable by webpack. Currently the examples all expect the output js to be imported as <script>'s in the html, so I wanted to see if I could remove that restriction. By making it one file I hoped to just modify the output js so it would follow CommonJS module syntax, ie module.exports = <thing being exported> and just import it into the other file using require. Now I don't see a clear way to do this.

If you have any suggestions I would be glad to hear them.

from animate.

bigtimebuddy avatar bigtimebuddy commented on May 6, 2024

In the publish settings in the PixiAnimate formatted FLA, there's an option to make output CommonJS compatible, which adds the module.exports business.

publish

from animate.

nthapaliya avatar nthapaliya commented on May 6, 2024

from animate.

nthapaliya avatar nthapaliya commented on May 6, 2024

Stuck with Uncaught TypeError: Super expression must either be null or a function, not undefined'.

I was unable to get this to work. const animate = require('pixi-animate') fails with the above error.

We're not using typescript, if that helps. Just regular es6, which is transpiled down to es5.

from animate.

bigtimebuddy avatar bigtimebuddy commented on May 6, 2024

I was unable to reproduce this error. Could you please provide more information, or a repo which demonstrates this problem? Also, please provide the version of Node (node -v) you're running.

from animate.

nthapaliya avatar nthapaliya commented on May 6, 2024

My issues turned out to be version issues. I was using the wrong version of pixi for the library. We're stuck at pixi v4.3.0 for the moment, so I downgraded the pixi-animate version so that they were compatible.

from animate.

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.