Jump to content


  • Content Count

  • Joined

  • Last visited

  1. I made a stationary and fast example right now and it seems to work, thanks. I will include that functionality in my game in the next days and will supply a solution to the problem here.
  2. Awesome, I'm gonna try that as well as soon as I have time.
  3. I can't test it right now but from what I understand this should work? Where 100 and 50 are the size of the sprite. And in my handler I keep my code(with addition of accounting for the things you listed) and work with the this.pixels array? let canvas = this.app.renderer.plugins.extract.canvas(); let context = canvas.getContext("2d"); context.drawImage(this.sprite.texture.baseTexture.source, 0, 0, 100, 50 ); this.pixels = (context.getImageData(0, 0, 100, 50).data);
  4. I tried your solution with the grey frame around the texture and it works actually great, thanks.
  5. So, I checked it again and the problem was neither CORS nor the webgl context. First of all, I didn't really check the entire array because it was simply too large. I used the following to get the pixel values where I clicked. But this does only work if I don't resize the image. If I use e.g. this.sprite.width = 100, this.sprite.height = 50 it only logs zero. Is there a possibilty to adjust the size and keep the pixel values correct? this.sprite.on("pointerdown", () => { let px = Math.floor(this.app.renderer.plugins.interaction.mouse.global.x - this.sprite.x); let py = M
  6. So, your workaround is to just put a grey frame around the texture with gimp or something? Haven't thought of that yet lol, I will try that solution tomorrow and provide Feedback. Your general solution would be nice I think as this should be a rather common problem I suppose. I will take a look at your fiddle after trying the border solution. Thanks
  7. Hello, I'm currently working on a little game with and Island and some (right now static) water, I was looking online for water-effects and found this, simple Article https://markhawkinsdesigns.com/blog/web-design/working-with-pixijs-v4-and-the-displacementfilter/ I really like that effect but how do I restrict the area so that some of the image (especially the borders of the image, they look weird) stays uneffected, right now it looks a bit like wet paper instead of water. I tried using masking but that doesn't really help because now we have the same Image in the background bu
  8. I'm working on the first point, but I don't think this is the case here. btw, renderer.gl.isContextLost() always returns false so I think there are no other contexts are created.
  9. So, I just set up a plain canvas and tried it with the ctx.getImageData(...) function, this returns the same Array with just all zeroes. Any Ideas why this is happening?
  10. I'm using the electron framework to create a desktop application
  11. Hello, I'm currently working on some small project with pixi but with more complex shapes. Now I wanted to look at the image data of my sprites but the pixel values are all 0. I searched on google and a few suggestions were that the renderer hasn't rendered anything yet or that the sprites weren't loaded, but this is not the case because if I take another sprite (the cat from https://github.com/kittykatattack/learningPixi) my program suddenly works (I get an array with more than just all 0). Does this have something to do with my images? They are just .png files with a transparent backgro
  12. Hello, I know this is my second Thread today but I found out about this forum today and I'm curious about the Problems I had while learning Phaser the past week, so sorry for that^^ My first game was a simple point&click game, where you could click an (moving) image & that image would appear somewhere new at random. Now the problem is that everytime I restart the scene (using this.scene.restart()) the object would start to stutter in the "new" Scene. The object always started in a random location and moved with moveTo(endX, endY, 100) to the other location. Is this becau
  13. thanks to both of you, that solved my problem
  14. Hello, I'm new to Phaser and currently playing with/learning phaser 3, I wrote a simple clicker game, where you just click on an object as long as you want and you will get Points for it. Pretty easy so far, but now I want clicks on the background to do something else. this.cookie = this.physics.add.sprite(400, 400, "cookie"); this.cookie.setInteractive(); this.handleObjectInput(this); handleObjectInput(context) { this.input.on('gameobjectup',(pointer, gameObject) => { //do stuff with the clicks on the cookie }); } In my
  • Create New...