Fedor

Members
  • Content Count

    61
  • Joined

  • Last visited

Everything posted by Fedor

  1. I found a simpler solution: check event.data.originalEvent.button - if it is 2, it was a right click. 0 is a left click. You still need to prevent the context menu to show up.
  2. @botmaster: in my case I don't think it's bad structure. The child that should remain it's own scale is a bit of text. It follows the sprite but it should not resize when the sprite resizes.
  3. Fedor

    Is EZGui still alive?

    ...I got a response, the developer just pushed a new version that is updated to the latest Pixi-version and he intends to keep it updated to the latest version.
  4. That would be a solution, but my objects are grand-grand-grand-children of other objects so I would need to iterate through all te parent scales... I might try that.
  5. I could also keep the text apart from the object, but then I would need the screen coordinates of the object and move the text thereevery update. But the DisplayObjects have no method to get the screen coords, or I must be overlooking something...
  6. Is there a way to keep a child on it's original scale when scaling the parent object?
  7. Fedor

    Is EZGui still alive?

    anyone who knows? Or knows how to contact the makers succesfully?
  8. I was looking into EZGui for my project, it looks great and I was looking forward to integrate it in my application. But then I found it only works with older Pixi versions. And there is no sign on the website that tells me if the developer is still on it. I send them an email, and maybe I am impatient but they did not yet respond. Does anyone know if EZGui is still alive and if it is likely to be updated soon to work with Pixi 4?
  9. Great, that just works... I've seen a lot of answers out there that were a lot longer and did not work...
  10. I have a simpler solution. In the event handler that cancels the contextmenu event on the canvas, I also set a variable window.wasRightClick this.graphics.view.addEventListener('contextmenu', (e) => { window.wasRightClick=true; e.preventDefault(); }); In the handler fired on mouse down on a sprite or other object, I can now test for it. At the end of this event I reset the variable to false. this.click = function(event) { event.stopPropagation(); if (window.wasRightClick) acGame.showInventory(this.acParent); else acGame.showCommands(this.acParent); window.wasRightClick=false; return false; }
  11. When I attach an event to a sprite, like sprint.on('click',clickresponse) I would like to know which of the hundreds of sprites fired this event. But somehow the event does not contain a pointer to the sprite that fired the event. I would have thought currentTarget would be a good candidate to test for it, but that one seems to be null allways. How to figure this out?
  12. Fedor

    WebP

    @Ivan, what does this post got to do with WebP?
  13. Fedor

    WebP

    Does anyone know where to find the fileformats PixiJS supports? Or is the support simply the same as the browser support for file formats? To be more specific: does PixiJS support the WebP fileformat? It would be great if it did, since WebP offers better and higher compression than PNG and JPG.
  14. Fedor

    Documentation

    Sorry, found it, just move up a folder level and the download zip button is there...
  15. Fedor

    Documentation

    did you manage to download them? I can't find an option to zip them, and downloading them one after an other will be quite some work...
  16. https://stackoverflow.com/questions/25942955/phaser-pixi-normal-map-filter-not-working These are a number of these posts...
  17. I am trying to find out about the implementation of lights and normal- or bumpmapping in Phaser. I found some older posts here and on other sites about dynamic lighting and bump mapping but if I interpret the information given, the lighting features have been experimented with in earlier features, but were discarded in later versions. Can anyone tell me if dynamic lighting and bumpmapping is on the official Phaser roadmap and when to expect it. I know that Pixijs has a special branch that has lighting features and there is a pixijs plugin for lights. Does anyone know of a Phaser plugin for this?
  18. That helps... for the PG example... http://www.babylonjs-playground.com/index2_5.html#460BZJ#17
  19. @sable, Fastcheck does not help me here. I need accuracy when picking UV coordinates. Fastcheck does picking using only the bounding box. And what do you mean with the double render - I have one scene.render() in the code...
  20. Ok, but in fact I am doing the same: the texture.update is my example is also in it's own loop... And you leave out Picking here, which seems to be the biggest problem...
  21. Do you base that conclusion, that Picking can be called every frame, on this example? There is a difference: this scene has a lot of objects with each just a few faces. My scene only has one object with a lot of faces. That may be significant. I tested it and put the picking function in the draw function so it is now executed every frame. Frame rate when doing nothing drops from 60FPS to around 40FPS. http://www.babylonjs-playground.com/#460BZJ#13 But in a sence you are right, it is not the only problem... I tried switching of the texture.update() (which fired every 10th second) and the FPS went back to 60: http://www.babylonjs-playground.com/#460BZJ#14
  22. Got it: http://www.babylonjs-playground.com/#460BZJ#12 On my machine the frame rate of this example is around 8FPS.
  23. @jerome and @NasimiAsl my application does not clean the canvas or redraws a lot - it just ad the last brush strokes on the canvas. This involves drawing the brush image 30 times on average per frame. This is nothing to the canvas element performance wise. The size of the canvas does not really affect performance while drawing. I did test 'stop drawing each frame', now using update() at certain intervals. Here are some benchmarks: Action: continuous drawing by holding down the mouse button and moving it over the mesh, measured on Firefox Drawing on 1024 texture, update every frame (provided something has been drawn): around 20FPS, allmost smooth Drawing on 4096 texture, update every frame (provided something has been drawn): around 5FPS, drawing stutters Drawing on 4096 texture, update only every 100ms: 3FPS (15FPS on Chrome), drawing stutters heavily Drawing on 4096 texture, update only every 200ms: 5FPS, drawing stutters heavily Drawing on 4096 texture, update only every 500ms: 8FPS, drawing stutters heavily Drawing on 4096 texture, not updating at all: 20FPS, but we don't see any results Drawing on 4096 texture, not updating and drawing commented out in the onMouseMove: ALSO 20FPS (same on Chrome), but we don't see any results I took the frame rate from the debuging layer. It looks like texture update is not the only problem. Holding the mouse button down somehow also eats a lot of time. But it could also be the scene.pick(scene.pointerX, scene.pointerY)-function which I had not commented out. Tested that: 8. Drawing on 4096 texture, not updating and drawing commented AND picking out in the onMouseMove: 45FPS (55FPS on Chrome) --- WOW!!!! Tested it a second and third time. Looks like Picking is even more time consuming! I'm now trying to mock up a demo in Playground to proof it and allow further investigation.
  24. Still working on my sculpting tool, I am now testing basic texture paint functions. I am using a single dynamictexture that is only updated just before rendering IF anything has been painted. When I keep the texture small - say 1024^2 -, the speed is reasonable, when increasing it - to 4096^2 - performance drops dramatically. I am pretty sure it is not the drawing functions or the canvas, I have created applications in the past that draw much more in a single frame then I do now. (see http://www.traxeditor.com if you like) It looks like it is the Dynamictexture update() method. Does anyone have any ideas how to speed it up or work around it? Is there an other way to paint the texture?