lunarovich

Members
  • Content Count

    8
  • Joined

  • Last visited

About lunarovich

  • Rank
    Newbie

Contact Methods

  • Twitter
    https://twitter.com/darko_draskovic
  1. It appears that it's definitely a bug. Here is a bug report and a barebones JSFiddle example (included in bug report also).
  2. Hello. Since I've migrated to V3, I have a strange issue with polygon drawing. Every time I want to draw a polygon object that has 5 or more vertices, the given alpha value to the .beginFill is ignored and alpha = 1 is used insted. Here is the code chunk from my game framework Dodo: DODO.drawPolygon = function (graphics, polygon, props) { _.isObject(props) || (props = {}); graphics.clear(); graphics.beginFill(props.fillColor || DODO.Colors.violet, props.fillAlpha || 0.5); graphics.lineStyle(props.lineWidth || 2, props.lineColor || DODO.Colors.green, props.lineAlpha || 0.67); graphics.drawPolygon(polygon.points); graphics.endFill();};I use it for debug purposes to draw a collision mask: Or the other example:
  3. Thank you very much. Evertything works just fine now.
  4. Hello, in pixi.js V2 I was using getMousePosition() of the Stage class to read a mouse position in every frame. In V3, the Stage class is gone, together with its getMousePosition(). Now, in V3, I know that InteractionManager has a property .mouse, which is of the type InteractionData. However, I do not know how to grab a reference to the automatically created instance of the InteractionManager. On the other hand, if I try to instantiate the InteractionManager myself, I can read a global mouse position. However, all the mouse events are reported twice, which is unacceptable... Lastly, there is no callback possibility for .mousemove on regular DisplayObjects/Containers, so I cannot read the interactionData in every tick.
  5. I'm developing a game framework and I've just migrated to Pixi.js V3. After some bumps on the road - undocumented loader & interaction management changes - I've managed to put it in the working state. However, one problem is pestering me: every time I press a mouse button on the sprite or container, or release it, two events are registered instead of one - two on the 'mousedown' and two on the 'mouseup'. This happens with left as well as with right mouse button. Now, I did not change anything in my code and everything was working fine with Pixi.js V2. Does someone know what is going on here? Thank you in advance! UPDATE: I've just realized that two events are produced because I have manually instantiated InteractionManager with new PIXI.interaction.InteractionManager(renderer);Apparantly, pixi automatically creates an interaction manager. However, I do not know how to find the reference to that manager. I need to read out container mouse position in every tick... UPDATE: I've just opened a new topic here, because this issue is resolved initself, but my problem of reading a mouse position in every frame in pixi V3 isn't.
  6. Hello, I am building a game engine using Pixijs & SATjs and Tiled to construct maps. For optimization reason, I am rendering layers (DisplayObjectContainers) that contain tilemap sprites on RenderTextures with a following code: bakeLayer: function(layer) { var renderTexture = new PIXI.RenderTexture(this.width, this.height); var sprite = new PIXI.Sprite(renderTexture); renderTexture.render(layer); sprite.alpha = layer.alpha; sprite.level = layer.level; sprite.position.x = layer.position.x; sprite.position.y = layer.position.y; sprite.parallax = layer.parallax; sprite.name = layer.name; sprite.tilemap = layer.tilemap; sprite.collisionResponse = layer.collisionResponse; sprite.baked = true; return sprite;},Now, in Chrome & Opera everything works fine: However, in the Firefox I am getting the following result: Now, in PIXI documentation I've read that "All DisplayObjects (i.e. Sprites) that render to a RenderTexture should be preloaded otherwise black rectangles will be drawn instead." However, if that was the case, neither Chrome nor Opera should have rendered it correctly. For the record, if I turn off the baking option, everything works fine in the Firefox as well. A blue pipe is also baked and is on the top of the level display object container. Curious thing is that it's the only layer that is baked (rendered on rendertexture) that gets displayed correctly...
  7. Hello! A curious thing happens when I try to get the localBounds of the sprite in every tick. The animation speeds up considerably. A simple this.sprite.getLocalBounds(); in every tick is a culprit. Also, when I try to read translated local coordinates of the sprite, the animation is even faster. I have a wrapper object around a PIXI.Sprite. The animation acceleration happens when I do this in every tick: return A_.level.container.toLocal(A_.level.origin, this.sprite);where the level origin is a simple PIXI.Point set to (0, 0) and container is a PIXI.DisplayObject. (A_. is a namespace wrapper around my library.)