shashank

Members
  • Content Count

    8
  • Joined

  • Last visited

  1. I am getting 3 as value of window.devicePixelRatio in mobile. And i have not zoomed my mobile browser content and did not set windows display settings to anything.
  2. When i am drawing any sprite usign pixi its looking blurry on both mobile (android mobile ) and pc (chrome browser) Then i tried setting (roundPixels: true). Then it becomes sharp on pc but still blurry on mobile devices. I have looked at forums but could n't get any help. I tried looking on stackOverFlow but i got nothing which could actually resolve my problem. I have used below code. var gs = {width:950,height:640}; var app = new PIXI.Application(gs.width, gs.height, { resolution: 1, antialias: false, forceFXAA: false, forceCanvas: false, autoResize: true, transparent: false, backgroundColor: 0x000000, clearBeforeRender: true, preserveDrawingBuffer: false, roundPixels: false }); var down = PIXI.Sprite.fromImage("images/icon.png"); down.anchor.set(0, 0); down.position.set(100, 150); app.stage.addChild(down); Please help.
  3. I have used code below to find device is mobile or not. var ua = window.navigator.userAgent.toLowerCase(); isMobile = ua.indexOf('mobile') !== -1 || ua.indexOf('android') !== -1;
  4. shashank

    Pixi Display

    Thanks ivan.popelyshev it worked.
  5. shashank

    Pixi Display

    I am working with JS (es5) I want to put zOrder to different sprite and containers. I tried using below code from pixijs example but found PIXI.display is undefined and got error (Cannot read property 'Group' of undefined) var greenGroup = new PIXI.display.Group(0, true); greenGroup.on('sort', function (sprite) { //green bunnies go down sprite.zOrder = -sprite.y; }); Is there any extra file i need to include in index with pixi library?
  6. shashank

    Pixi Display

    I am working with JS (es5) I want to put zOrder to different sprite and containers. I tried using below code from pixijs example but found PIXI.display is undefined and got error (Cannot read property 'Group' of undefined) var greenGroup = new PIXI.display.Group(0, true); greenGroup.on('sort', function (sprite) { //green bunnies go down sprite.zOrder = -sprite.y; }); Is there any extra file i need to include in index with pixi library?
  7. Thanks ivan.popelyshev i will do as you said.
  8. I have loaded SpriteSheet using json. Like this below. const loader = new PIXI.loaders.Loader(); loader.add('bunny', 'data/bunny.png') .add('spaceship', 'assets/spritesheet.json'); loader.load((loader, resources) => { }); I want to remove all the TextureCache which was loaded using this spritesheet.json only. I have tried. PIXI.Texture.removeFromCache("spaceship"); PIXI.Texture.removeTextureFromCache("spaceship"); But in PIXI.TextureCache names of all the spriteFrame were included there. And still i am able to use image form frame. Using this. var bgSprite2 = PIXI.Sprite.fromFrame("ship1"); bgSprite2.anchor.set(0.5, 0.5); var pos = {x: 300, y: 200}; bgSprite2.position.set(pos.x, pos.y); stage.addChild(bgSprite2); I want to remove all the entries of spriteFrame in TextureCache and i want to load new set of spriteFrame. I am doing this because i have spritesheet animations of two diffrent spaceship but the individual symbol name of both spaceship are same. Please help.