Exca

Members
  • Content count

    120
  • Joined

  • Last visited

About Exca

  • Rank
    Advanced Member

Recent Profile Visitors

1,434 profile views
  1. Changing hue in multiple sprites

    I cannot share the haxe code directly, but I'll see about making a pure js solution afterwards. Havent got an invite and yeah, I use slack, so invite would be ok.
  2. Changing hue in multiple sprites

    TS is good I use haxe mainly and TS -> Haxe is much nicer to port than what js -> Haxe is. Have to check that out.
  3. I have a situation where I have about 200 sprites to which I need to change hues. Is the best way for this to create a custom renderer with default sprite shader replaced with custom one changing the hue? Another option would be to use filters, but I think that might be pretty slow? Canvas support is not needed and I cannot cache those as they have spritesheet animations -> would require lots of memory.
  4. Collision detection

    Well spotted, fixed the error to original post.
  5. PIXI sprites are blurry on mobile devices.

    Does the canvas have somekind of transform applied to it with css? That might make things look a bit blurry also.
  6. Replacing sprite with one solid color?

    Yep, that is the way.
  7. Replacing sprite with one solid color?

    Here you go: var sprite = new PIXI.Sprite(PIXI.Texture.WHITE); sprite.tint = 0xff0000; //Change with the color wanted sprite.width = 100; sprite.height = 100; maincontainer.addChild(sprite); Or if it's something that currently exists you could change the sprites .texture to PIXI.Texture.WHITE and tint it. [Edit]. If you need to have sprite change between normal display and completely tinted then just keep the normal texture stored somewhere and set it back to texture after tinting part is done.
  8. You have basically these options (as far as I know) 1. Use a browser supporting local files. (For example the NWjs in the previous post) 2. Creating a local web server and hosting files through that. I use a small python server whenever I need to run something locally outside of development. 3. Use a tool like Fiddler to create response from local system on certain urls. (I use this method) 4. Run chrome with --allow-file-access-from-files flag. 5. Put everything you need to load inside js file as base64 and parse the data dynamically. (not recommended)
  9. Single Large Graphics Object vs Multiple Graphics Objects

    I'm not 100% sure how the graphics work on the rendering front, but to my knowledge rendering graphics is more expensive than rendering sprites. Someone else might be able to give a better answer regarding the reason why that is so.
  10. Single Large Graphics Object vs Multiple Graphics Objects

    You could use a single white rect, create a texture from that and then create sprites from that texture. The color would come from tinting a sprite to wanted color. That would be much faster than using graphics.
  11. text height isue

    Does text.updateText() help?
  12. Can PixiJSv4 Know Android Screen Orientation?

    You could also do a css media query with window.matchMedia. For example: var query = window.matchMedia("(orientation:landscape)") var isPortrait = !query.matches;
  13. How to cull objects out of camera view?

    Oh yeah, viewport is my own object that basically stores the info about what areas to render. Usually the size of the renderer.
  14. Bad performance on 4k/retina displays

    Chrome debug tools have a good rendering counter which doesnt end up making performance worse. It can be found from f12 -> ... -> more tools -> rendering -> show fps.
  15. How to cull objects out of camera view?

    I use a script like this: for( var i = 0; i < allObjects.length; i++) { var object = allObjects[i]; var bounds = object.getBounds(); object.renderable = bounds.x >= viewport.x && bounds.y>=viewport.y && bounds.x+bounds.width <= viewport.height && bounds.y+bounds.height <= viewport.width; } Using visible = false means that your transforms do not get updated, that's the reason why worldtransform.tx is not working. Renderable keeps updating the transform but just skips the rendering.