Jump to content

how to convert my custom textureatlas loader to latest pixi.js?


Elrinth
 Share

Recommended Posts

Here's my loader code which worked on the old version of pixi.js (1.6.1)
http://pastebin.com/4032KFxm

But now there's a new loader implemented, and I don't understand how it works. How can I make my loadercode work for the latest pixi.js?

 

Basically you send a file called "assets/gfx/something.sprdef" to the loader
which had forexample this line in it: 42,42
then it'd take the same name as above, but replace .sprdef with .png, then split the png into 42 wide and 42 high textures which then could be used in pixi.

Then I could easily use it with:

player = PIXI.Sprite.fromFrame("assets/gfx/something.png0");

 

But it'd also support making many different for example if you wrote in the .sprdef: 
000,000,008,008,016,016,Font1
 

it'd start from position x:0, y:0 and grab sprites at 8 pixels wide and 8 pixels high. 16 in x-direction and 16 in y-direction. Then name it Font1.

Ofcourse the naming part is not implemented as you can see in the code.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...