psumstr

Members
  • Content Count

    4
  • Joined

  • Last visited

About psumstr

  • Rank
    Newbie

Profile Information

  • Gender
    Not Telling
  1. Thanks Dave. I guess I was expecting it to work like the other events. Since my sprite is based off of a circle shape, I added the hitArea property and added the following to the mousemove callback: circleSprite.mousemove = function(interactionData) { var interactionManager = new PIXI.InteractionManager(); if(interactionManager.hitTest(this, interactionData)) { console.log("mousemove over sprite"); };};Everything is working now as expected.
  2. Hi Pixi experts, I'm trying to trigger a callback every time I "mousemove" over a sprite and I haven't been able to get that to work the same way "click" and "mouseover" work. I've made my sprite interactive, but the mousemove callback gets trigger anytime the mouse moves anywhere in the scene, not just over the sprite. click and mouseover events work fine. I'm just getting started with Pixi and I'm using v 2.1. Are there any steps I'm missing? var circle = new PIXI.Graphics();circle.beginFill(0xFFFFFF);circle.drawCircle(0,0,100);var circleTexture = circle.generateTexture();var circleSprite = new PIXI.Sprite(circleTexture);circleSprite.tint = 0xBEABEA;circleSprite.scale = new PIXI.Point(0.5, 0.5);circleSprite.interactive = true;circleSprite.mousemove = function(interaction) { //callback code };
  3. Thanks Sebastian, that makes sense. Any idea if I can apply the same concept but to circles, where I need to change the radius of the circle instead of the width/height? Not sure how to do that with Sprites.
  4. Hello, I'm in the data visualization field and I'm trying to see if I can leverage Pixi.js to create various charts that I've typically be created with SVG. Right now, I'm trying to create a bar chart with position and height changes as the data updates. I've been creating one PIXI.Graphics per bar and I'm updating the graphics width, height, and y positions when the data changes. // This runs ones per bar var rect = new PIXI.Graphics(); rect.beginFill(0x4682B4);rect.drawRect(0, y, width, height);doc.addChild(rect); // When updating barsrect.clear();rect.beginFill(0x4682B4);rect.drawRect(0, y, width, height); My questions are:1. If I'm planning to draw hundreds of bars, is Graphics the right object to use?2. Can I use sprites if I'm going to have different fills, width, and heights for each bar? I'm very new to PIXI, so I'm still trying to learn the API and figure what's the right set of objects to use for the job.