SET001

Members
  • Content Count

    33
  • Joined

  • Last visited

About SET001

  • Rank
    Advanced Member

Recent Profile Visitors

846 profile views
  1. thanx, I'll try pixi-tilemap. Even with it I think I would need mange tiles to have only visible on screen (and around) to not load all tiles in the large world there...
  2. I do not understand why do I need to call `render` why it should be called inside `ticker` I don`t understand how I can draw some static texture on come container I don't understand how I can I avoid creating million of Sprite objects just to draw 10 static tiles on a texture or at least how to avoid FPS drop causing by that If you can help to put a light to any of this questions - I would be thankfull
  3. I saw that example but being new to pixi.js I can't understand how it work. In this example it will still create as many Sprite objects as tiles on the map, add them to the container, add sprite with texture (which is empty, because rabbit sprites are added to the container) to the stage and then, using ticker (some sort of render loop?) will render container with rabbits, using render texture used previously to the sprite (which added to the stage)... I just don't understand how everything is working here. What actually is causing drawing rabbits on texture?? Why I can't draw it once, why I need those tickers loop? In my case I just add few containers as a child for some root container. then I add dynamic entities on one container and static entities on another. Everything gets rendered as soon as i call addChild for `app.stage` with rootContainer as argument: rootContainer = new PIXI.Container() textureContainer = new PIXI.particles.ParticleContainer(200000) entitiesContainer = new PIXI.particles.ParticleContainer(200000) init(store: Store) { const resolutionX: number = window.innerWidth const resolutionY: number = window.innerHeight this.app = new PIXI.Application(resolutionX, resolutionY) document.getElementById('app').appendChild(this.app.view) const tiles = PIXI.BaseTexture.fromImage(`${config.publicPath}/tiles.png`) const tileSize = 32 const grassTile = new PIXI.Texture(tiles, new PIXI.Rectangle(tileSize * 56, tileSize * 14, tileSize, tileSize)) for (let i = 0; i < 1000; i++) { for (let j = 0; j < 1000; j++) { const grass = new PIXI.Sprite(grassTile) grass.position.x = i * tileSize grass.position.y = j * tileSize this.textureContainer.addChild(grass) } } this.rootContainer.addChild(this.textureContainer) this.rootContainer.addChild(this.entitiesContainer) this.app.stage.addChild(this.rootContainer) } Why do I need calling `render` in `tickers` loop? with this approach i have few drawbacks: 1. the loop that will create 1000 x 1000 = 1 000 000 sprites and this loop is time expensive. Is it possible to somehow optimize this? The only optimization here I can think of is to draw only visible tiles. But at leas this happens once at the and of the game. 2. 1 million sprites will constantly present in system which as I guess, causing FPS drop. The FPS is actually as smaller as many sprites I add, so am I right thinking that sprites amount causing it? How this problem solved in http://pixijs.io/examples/#/basics/render-texture.js ? With that approach I will end up with same 1 million sprites causing FPS drop?
  4. are there any examples of how one would do this? I'm trying to implement simple tiling system so I need to draw thousands and millions of tiles. If I would go and create 1000x1000 sprites I will have decreasing FPS, event if using ParticleContainer. Instead of having each of them as spite object, I suppose to find a way just to draw it once somehow in container.
  5. SET001

    React Fiber Renderer

    having about 20k bunnies and still 60fps
  6. this is where click action triggered - http://phaser.io/docs/2.4.2/Phaser.Pointer.html
  7. Something like this to handle right mouse click: this.game.input.onDown.add((pointer: Phaser.Pointer, x: number, y: number)=>{ if (pointer.rightButton.isDown){ // .. draw menu at x, y } }) but still you need you'r own stuff to draw custom menu. Also you may want to disable default right click menu: this.game.canvas.oncontextmenu = (e) => e.preventDefault()
  8. I'm experiencing FPS decrease to about 43 from 60 on 100x100 (128x128) with native Phaser tilemaps. I'm gonna test library you pointed on but I think, with such map sizes, some dynamic methods should be used. Can some one point on any information about such approaches? As I want to have a really big worlds.
  9. Indeed! Can't believe I missed that looking in code. Thanx!
  10. This is also annoying in unit tests output when you have new game instance created before each of hundreds tests. Currently in my tests I'm turning this off by overriding showDebugHeader with empty function: beforeAll(()=>{ Phaser.Game.prototype.showDebugHeader = function(){} }) But it would be nice if we have valid switch for that.
  11. there is nothing except this, on the top right
  12. Yes but I think there should be a way to have a % in loading screen from 1 to 100, not just 25, 50, 75, 100.
  13. `loadUpdate` triggering few times with values 25, 50, 75, 10. But I need to show progress from 1 to 100. How can I do this?