• Content count

  • Joined

  • Last visited

About OSUblake

  • Rank

Contact Methods

  • Twitter

Recent Profile Visitors

1,041 profile views
  1. Scaling down big images quality

    You can create a texture from a base texture that is power of two in size. var texture = new PIXI.Texture(baseTexture, new PIXI.Rectangle(0, 0, 200, 200));
  2. Collision between sprites

    You have to install it with npm, but here's a version of it. It only works with convex polygons. https://codepen.io/osublake/pen/f0122809730d67335264dcd50f44cad7.js Another way to do this is to check for edge intersections between polygons. That will work with concave polygons. Here's the compiled code for that demo. https://codepen.io/osublake/pen/eMvZmo.js
  3. Collision between sprites

    I'll take a look at the library later, and will make a simple demo.
  4. Collision between sprites

    From what I can tell Bump only works with points, circles, and rectangles. This looks like it will handle polygons. https://davidfig.github.io/intersects/ https://github.com/davidfig/intersects
  5. Collision between sprites

    You can use polygons for your hit areas. It doesn't have to be pixel perfect. Now google how to do polygon collision detection. There are a lot of resources for this. For convex polygons you can use the Separating Axis Theorem (SAT). https://developer.mozilla.org/en-US/docs/Games/Techniques/2D_collision_detection#Separating_Axis_Theorem Here's an example of SAT with phaser. http://hexus.github.io/phaser-sat-example/ https://github.com/hexus/phaser-sat-example
  6. Issue with context 2d

    In your screenshot you have a reference to the canvas element, so it will still be in memory. And I'm not 100% sure, but I don't think there will be any image data until you call getContext. A 10000 x 10000 bitmap will of course eat up some memory.
  7. Generate a white texture of the polygon... http://pixijs.download/dev/docs/PIXI.Graphics.html#generateCanvasTexture Then you can color a sprite with that texture using tint.
  8. Container background color without graphics?

    Did you set the width, height, and tint? var bg = new PIXI.Sprite(PIXI.Texture.WHITE); bg.width = 800; bg.height = 500; bg.tint = 0xff0000;
  9. Here's an example in v3. I think I got the original idea from bQvle.
  10. scale.x and scaleX, specificially for GSAP

    You can use scale, scaleX, and scaleY with the PixiPlugin.
  11. Microlags with fast-moving objects

    Have you profiled your code? Garbage collection is a common reason you might see a dropped frame. To make the lag less noticeable, try adding an slight ease to the animation. It will be much harder to notice lag when the object isn't moving at a constant speed. Or you could make your animation frame dependent. Move it the same amount on every frame, like in this example. http://pixijs.github.io/examples/#/layers/lighting.js
  12. Microlags with fast-moving objects

    That's what it is doing under the hood. Tweening is interpolation. And TweenLite has some lagSmoothing built into it, but that won't fix your issue, which is dropped frames in a linear animation. It doesn't matter if you manually interpolate the position or use a tween, if more than 33ms pass between ticks, you're probably going to notice it. let now = performance.now(); let delta = now - lastTime; lastTime = now; if (delta > 33) { // lag }
  13. Microlags with fast-moving objects

    Hi @vdddslep I look at your demo and noticed dropped frames, which will be very noticeable in an linear animation. If you don't use interpolation and move your object the same amount on every animation frame, it should fix the problem. However, that might not be a good idea as it might get out sync with other parts of your game.
  14. PIXI positioning + flickering questions

    This repo might be of some help. It's part of the Cocos Creator, and handles zoom/panning without flickering by snapping everything to whole pixel values. Note that antialias is set to false. https://github.com/cocos-creator-packages/ui-grid
  15. It looks like touches are back in 4.5.2... https://github.com/pixijs/pixi.js/issues/4040 And they added a isPrimary property to the event data, which would be true for the first touch. console.log(e.data.isPrimary);