Robert Nguyen Posted February 1, 2021 Share Posted February 1, 2021 I have this image and i's tried to add into my project. but this quality is not good.So I need your help! i'm a newbie in pixijs this my code : var textureButtonOver = PIXI.Texture.from('assets/arrow_02.png'); arrowSprite = new PIXI.Sprite.from(textureButtonOver); arrowSprite.anchor.set(0.5); arrowSprite.position.set(0, 0); arrowSprite.width = 150 * 2; arrowSprite.height = 150 * 2; arrowSprite.scaleMode = PIXI.SCALE_MODES.NEAREST; mainContainer.addChild(arrowSprite); Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted February 2, 2021 Share Posted February 2, 2021 You tried scaleMode, buts its different texture parameter You are downscaling more than 2 times, so you need mipmap! If you dont want to use it, just scale texture in photoshop that way it wont be ever downscaled more than x2. sprite.texture.baseTexture.mipmap = PIXI.MIPMAP_MODES.ON; scaleMode also exists in baseTexture, not sprite itself. Sprite - the instance in stage Texture - region (rectangle) + baseTexture BaseTexture = actual texture that is stored Beware, mipmaps work in webgl1 only if texture has power-of-two size (512x512, 256x256, 256x512, e.t.c.) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.