Jump to content

Displaying tile images using composite tilemaps


OJs
 Share

Recommended Posts

I would appreciate any insight and response as regards  composite tilemap

I guess I am still missing some information while still trying to grasp the composite tilemap techniques in PIXIjs

Here is a snippet of the code;

    this.app.loader

         .add('map0', '/assets/level_1/level_0.json') //1 image in json

         .add('map1', '/assets/level_1/level_1.json') // 4 images in json

.load((loader, resources) => {

         let textures =[];

         for (let i=0; i<4; i++){

           const texture = PIXI.Texture.from(`wall1_${i}.png`);

           textures.push(texture)

           const image_1 =  this.app.loader.resources["map1"].textures;

           console.log(image_1)

         }

       });

// While trying to use composite tilemap, however, I believe I am still missing some steps as this is crucial to make the tiles display hence I would appreciate insight on how to get the tiles displayed

on the canvas.

const tilemap = new CompositeTilemap()

    //--Level_1--//

       tilemap.tile(level_1["wall1_0.png"], 1, 1, {

       tileWidth: 256,

       tileHeight: 256,

     });

this.viewport.addChild(tilemap)

 

Regards

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...