1.0.9 • Published 4 years ago

p5-asset-manager v1.0.9

Weekly downloads
-
License
MIT
Repository
-
Last release
4 years ago

p5 Asset Manager

All the p5 image loading you could ever want or need.

Version Number NPM npm bundle size p5js TypeScript

p5 Asset Manager is a super neat and tidy utility library that helps you to manage your assets and loading within p5, as well as avoid common issues like loading an asset multiple times, being stuck with unweildy URLs instead of easier names, or not being able to load it within a single frame.

It lets you create an AssetManager class with p5 that stores, caches, fetches and manages your assets for you inside your p5 app, whilst trying to maintain a super simple interface for you to interact with.

Why is p5 Asset Manager?

p5 already has loadImage(), I hear you ask. Why do we need something else to do the same thing?

Well, it's true p5 has asset management already, but it suffers in a few areas, if you want to show any custom loaders, you're fresh out of luck, and you need to do a ton of work in order to load assets outside of preload and setup, e.g. in the draw method.

This library tries to simplify things by doing that for you. It's not much, but it's honest work.

It's also built with super old browsers in mind... like pre-promises old. So it'll probably work all of the time, most of the time.

Where is p5 Asset Manager?

You can grab the latest build here!

https://cdn.jsdelivr.net/npm/p5-asset-manager/library/p5AssetManager.min.js

Or, in production, you can add a version number like shown:

https://cdn.jsdelivr.net/npm/p5-asset-manager@1.0.9/library/p5AssetManager.min.js

We're also available via npm.

npm install p5-asset-manager

How is p5 Asset Manager?

Pretty good, thanks for asking! How about you?

Examples

There's a bunch of ways that you can use p5, and we have examples for all of them!

The source code is available in examples/ for you to check out!

Global p5

Simple Example

Interactive Example

Instanced p5 (with p5 Method)

Simple Example

Interactive Example

Instanced p5 (with direct class use)

Simple Example

Interactive Example

License

MIT

1.0.9

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago