amshegarh

Members
  • Content Count

    15
  • Joined

  • Last visited

Everything posted by amshegarh

  1. Unfortunate, oh well, i guess i'll just have to write another function, i'll just assume that PIXI.Texture.frame is the property i need Thanks
  2. Ok there is a problem, when i try to refer to base texture of a texture in spritesheet in such fashion PIXI.Loader.shared.resources["spritesheet"].spritesheet.textures["Image144.png"].baseTexture returned base texture is in fact of the whole spritesheet, but i need base texture of a single texture in spritesheet How do i do that
  3. Yeah I have a working function already to cut a texture, not sure about its performance, but it does work
  4. I've seen this question before, has anything changed? I need to get texture(s) from spritesheet, sometimes texture needs to be cut in several ones and placed in different sprites, previous answer only took texture from img src and it was something more complicated than it should be for task this simple
  5. Alright there is another issue, pivot seems to work weirdly(?) i need to set up rotation point in sprite while also having custom anchor, but it just doesnt work the way i expected example: https://www.pixiplayground.com/#/edit/NGUb4kYSI8DXK6O4X5Jmz bunny2 should keep its position, but rotate 90 degrees around pivot point (its centre) but it just does some nonsense :: Apparently after rotation sprite uses original anchor to position itself, this is not ideal but i can work with it
  6. Very helpful tips, thanks! I changed the way rendering goes, now i create all sprites beforehand(a drawback is that loading is already noticeable, even tho no real sprites are used yet) and put most of them as .visible = false, works rather fine right now, might need reconsidering later. Also, as i said, i already did rendering based on current viewport position, it just didnt make it into demo because i thought it was mostly irrelevant
  7. ok it works now, but why it can be an issue later? does zindex is costly performance wise?
  8. Ok there is another issue, i set z-index of sprites, but some still overlap others, despite clearly having lesser zid (i must specify that there are rows of sprites with the same zid, but sprites from the same row can never overlap)
  9. Here you go, https://pastebin.com/9xpvVRa3 this is dumbed down version with pretty much only rendering, idk if it even runs, but it should be affected in the same way as my project Data files in case you actually want to start it https://drive.google.com/open?id=1GG1Liec4JoK1urjtW1yIeFePgadIMkkA
  10. i see, i'll prepare some demo but i'll take time to make code behave similarly to how it works right now
  11. 40k is amount of ALL tiles on map, visible are somewhere along 500 mark
  12. I do something similar to 1b, but currently it doesnt work very well. My tiles for the most part shouldnt be changed in game, but supposed to be changeable in real time in map and some point changes can occur. I intend to create a sprite for every tile and set visible of all to false, making visible only those that can be seen, how would that work? Given there are 40k+ tiles. What should i know about 2c? 2d idk if it will suit my demands, tiles will have height associated to them, some tiles will have a texture that covers larger area than their own et cetera
  13. As I mentioned, i have a map, isometric one, that heavily depends on draw order, while i indeed can create limited amount of sprites and change their positions and textures as needed, it would complicate things as now i'll have to manually track and change z-order, right now i just draw them every game cycle in needed order About error, i create sprites like so let sprite = new PIXI.Sprite(sheet.textures[this.cell(i, j).sprite]); since many sprites share the same texture, that might be the issue(?) this.cell...sprite contains only string name of texture as a side question, can i disable sprite in such a way that it doesnt affect performance (but high number of sprites, like 160k)
  14. Hey, I use pixi.js - v5.1.2, i need them to render map of the game, its also worth noting that 'Texture.js:445 Texture added to the cache with an id [Image43.png] that already had an entry' error pops up a lot (there are more than just one image), i grab textures from a spritesheet (its loaded only once tho) While there is probably a way to avoid creating hundreds of sprites every second via use of zorder (that i want to not do if possible), they must be created at least once and moved/deleted as map is way bigger than screensize, im afraid that this performance drops sooner or later anyway
  15. Hello, in my project i need to create a lot of sprites (we talking about 500 + something) every frame and destroy in next but alas, it seems that i dont dispose them properly and framerate drops extremely quickly, albeit at start it seems okayish I add each to some sprites container and clear it with sprites_container.removeChildren(); i dont keep references to sprites Id appreciate help regarding this issue