HTML5 Game Development
   
  • HOME
  • News
  • Tutorials
  • Engines
  • Demos
  • Tools
  • Partners
  • Mobile HTML Game
  • Guess The Celebrity
  • About us

PXLoader – A JavaScript Preloader for HTML5 Apps

PixelLab has released a JavaScript library to simplify the download of images, sound files and other various assets for HTML5 games called PxLoader.

Here’s a basic example from the site:

// Create the loader and queue our 3 images. Images will not 
// begin downloading until we tell the loader to start.
var loader = new PxLoader(),
backgroundImg = loader.addImage('/images/site/missing_thumb.gif'),
treesImg = loader.addImage('/images/site/missing_thumb.gif'),
ufoImg = loader.addImage('/images/site/missing_thumb.gif');

// callback that will be run once images are ready
loader.addCompletionListener(function() {
var canvas = document.getElementById('sample1-canvas'),
ctx = canvas.getContext('2d');

ctx.drawImage(backgroundImg, 0, 0);
ctx.drawImage(treesImg, 0, 104);
ctx.drawImage(ufoImg, 360, 50);
});

// begin downloading images
loader.start();

The source available on GitHub

[Via HTML5Devs.com]

Share List

You might also find this interesting:


  1. Designing Interactivity with HTML5 Workshop, Day 1 Updated: Fixed Links 12/19 The slides from Day 1 of my January Workshop at MassArt are posted up. I’m the process of converting them into a more useful tutorial format,...

  2. IvanK Lib: a WebGL based HTML5 engine IvanK Lib is a HTML5 Engine inspired by Flash (the tag line is actually "Like Flash, but faster" that uses the power of GPU accelerated WebGL to render 2d graphics...

  3. Painting the DOM to Canvas with Domvas Domvas is a tool that uses what amounts to a backdoor via SVG to allow you to turn DOM elements into images that can be painted onto a Canvas. Why...

  4. Ejecta: A Fast, Open Source JavaScript, Canvas & Audio Implementation for iOS Ejecta is a open-source native wrapper for iOS that has custom hardware-accelerated Canvas and native audio implementations for porting your HTML5 games into the apple App store. Released by Dominic...

  5. Instagram style filters in JavaScript Alex Michael has written a GPL’d JavaScript library that let’s you apply Instagram-style filters using Canvas and JavaScript entirely client side. Code is on Github. Share List...

HTML5 Tools

License HTML5 Games

Are you a company looking to license HTML5 games? We recommend MarketJS.com, a B2B platform for licensing games.

MarketJS has over 300 HTML5 games for licensing. They also provide additional services such as game reskin, custom development, and white label portals.

Html5 Game Development


Follow @GameDevHTML5



WHAT’S NEW

  • GPT3 Voting Board

  • Game Localization For Food Delivery App

  • HTML5 Games in Guest Room Tablets

  • What’s New in Phaser 3.50

  • Particle and Sprite Editors in Babylon.js 4.2



NEW DEMOS

  • Vertical Platformer Games Using GDevelop

  • HTML5 Games for HR Technology

  • Building Vertical Platformer Games using Kaboom

  • Vertical Endless Runner Prototype

  • Particle and Sprite Editors in Babylon.js 4.2


ENGINES

  • Vertical Platformer Games Using GDevelop

    Last time, we introduced GDevelop as a viable option for no-code game engines. Now, let’s try building vertical platformer games using GDevelop. GDevelop comes with two behaviors to build platformer …Read more

  • Best Practices in Building HTML5 Games

    As the saying goes, “Quality is always the result of intelligent effort.” This timeless quote by John Ruskin summarizes most of the best practices in building HTML5 games by today’s …Read more

  • GDevelop – Free and Easy HTML5 Game Engine

    If you are looking for a free and easy HTML5 game engine, check out GDevelop. This game creator is designed to be used by everyone, with its no-code, open-source, free, …Read more

SEARCH OUR ARCHIVES

CONNECT

rss twitter

HTML5 Game Development is proudly run by 3P Solutions Inc

GOT NEWS?

Send new engines, demos, information and tips to hello@html5gamedevelopment.com

MONTHLY MEETUP

In boston? Join us for the Monthly HTML5 Game Development meetup.

BOOKS

We're in the process of writing a few books about game development. Coming soon!

Copyright HTML5gamedevelopment.com