Jump to content

Pixijs increase image size


Ricky
 Share

Recommended Posts

Hi, i have a problem with pixijs about images

i've created a normal app

const app = new PIXI.Application({
    width: 1920,
    height: 1080,
    antialias: true,
    resolution: 1,
    transparent: false
});

i'm loading spritesheet and every image is : "sourceSize": {"w":209,"h":195}

after that with a simple for i start to show symbols

 

for (let j = 0; j < 5; j++) {
            const symbol = new PIXI.Sprite(slotTextures[Math.floor(Math.random() * slotTextures.length)]);
           
            symbol.anchor.set(0,0);
            console.log(symbol.width);
            console.log(symbol.height);
            reel.symbols.push(symbol);
            rc.addChild(symbol);
        }
        reels.push(reel);

but every symbols change size to

298.5714285714286
296 278.5714285714286

How is possible?

How can i take the right dimension?

 

Thanks

 

Riccardo

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