sergiy-oliynik

Members
  • Content count

    8
  • Joined

  • Last visited

  1. Slow performance on mobile

    Thanks. With your example i have 45 fps.
  2. Slow performance on mobile

    Hi for all. I'm trying to create application for mobile devices. I have some troubles with tag <meta name='viewport'>: 1. I have 59-60 fps if i set attribute content like this: content='initial-scale=no,width=device-width,initial-scale=1'; but images looks blured. 2. Images looks great if i set attribute content like this: content='initial-scale=no,width=device-width,initial-scale=' + 1 / window.devicePixelRatio; but i have 15 fps. I set options.resolution = window.devicePixelRatio || 1 for both cases;
  3. I'm looking for right way to manage my assets that for device with hd screen used default atlases, but for device with full hd screen or retina used 2x size atlases.
  4. Right way to manage stage size for web and mobile

    Thank to all. My code: var renderer; var stage; var width = 1280; var height = 720; window.onload = function () { renderer = PIXI.autoDetectRenderer(width, height); document.body.appendChild(renderer.view); stage = new PIXI.Stage(); var img = PIXI.Sprite.fromImage('img.png'); // size 1280x720 stage.addChild(img); window.addEventListener("resize", this.resize); this.resize(); } function resize() { var w = window.innerWidth; var h = window.innerHeight; stage.scale.x = w / width; stage.scale.y = h / height; renderer.resize(w, h); width = w; height = h; } Unfortunately, the game scene is scaled incorrectly
  5. Right way to manage stage size for web and mobile

    Thank for answer. window.innerWidth = 360, window.innerHeight = 615, window.devicePixelRatio = 2. My images still doesn't fit in the screen. Do I need to calculate scale coef. and scale all children of stage?
  6. I need to have a single code for web and mobile client. I wrote something lie this: var renderer; var stage; window.onload = function() { var w = screen.width; var h = screen.height; stage = new PIXI.Container(); renderer = PIXI.autoDetectRenderer(w, h); document.body.appendChild(renderer.view); } In my desktop (FullHD screen) w = 1536, h = 864, window.devicePixelRatio = 1.25, but it work correctly. In my android device (HD screen) w = 360, h = 640, window.devicePixelRatio = 2. As seen stage has half the size of the actual screen size (720x1280), but stage children has real and correct size(for example image 60x60 realy has 60 pixels). In result my stage content does not fit on the screen. How to fix it? I need to scale all stage children into ratio? For example: stageChild.scale.x = stageChild.scale.y = 1 / window.devicePixelRatio ? Sorry for my English:-)
  7. Hi anyone! I want to create panel of ui and I need to stretch a background of panel like Scale9Image in Starling. Can i do it? Thanks so much!