achexi

Members
  • Content Count

    30
  • Joined

  • Last visited

  1. achexi

    Handling none rectangular sprite collisions

    In this scenario your going to want to use circular detection in order to get more accurate collision. In rectangular collision, your checking what x and y axis the 2 objects collided at, this is different in circular collision as instead your trying to determine what angle they collided at. Using the center points and the radius's of the circles used for collision you can find what point they collide, and from the angle of collision you can work out a collision vector. Using physics you can work out what velocity the balls leave the collision at from the collision vector + their entry speeds. Edit: just noticed pixi has a circle class: http://www.goodboydigital.com/pixijs/docs/classes/Circle.html if your using pixi rects then use this instead and you should be good. Also if you don't feel like doing the physics part yourself there's hundreds of libraries designed to do physics, i would suggest something like box2d to make your life easier.
  2. achexi

    render texture on polygon

    There are a few ways of doing it, I would suggest creating a sprite/render texture for the image and apply a mask to it in the shape of the polygon.
  3. Your saying the issue might be related to a gfx object and a sprite? Have you checked the widths/height of the container? There's been reported issues of containers not returning the correct width/height.
  4. achexi

    Check collision between invisible Displayobjects

    Really it all comes down to how many objects you intend to have in regards to performance. But both visible false and alpha 0 result in the object not being rendered so from that side your ok.
  5. achexi

    Cancel subscriptions?

    Your method is correct, this is how it's normally done.
  6. achexi

    Using movie clips and replacing images

    I'm not quite sure what the question is here, you can use setTexture to change textures though.
  7. achexi

    PixiJS MovieClip keeps speeding up?

    Not sure what's wrong with it, haven't heard of it doing this before but maybe setting the fps property of the movieclip would fix it?
  8. achexi

    Pixi.js Now with masking! (webGL and canvas)

    I had this issue before, the workaround I used was to simply do a check to see if the part of the interactive object you click on is within the masks bounds.
  9. achexi

    Display hitarea of sprite

    You probably should just extend sprite and make your own. As digibo said its not something that should be included in a rendering engine built for speed, although I wonder how much of a performance impact it would actually have...
  10. achexi

    Do Sprites need children? You decide!

    Could you not place it all inside of a DisplayObjectContainer and perform transforms on that? Also my vote - yes to sprites, they definitely don't need them, but as its already been said it would require making more DOC's. It looks like it all just comes down to performance vs development, are the performance gains that noticeable?
  11. I had a similar issue to this before, I think it was to do with scaling the containers. If it is then you need to place them inside a parent object container and use that for scaling instead, something like: this.layer0 = new PIXI.DisplayObjectContainer();this.layer1 = new PIXI.DisplayObjectContainer();this.container = new PIXI.DisplayObjectContainer();this.container.addChild(this.layer0);this.container.addChild(this.layer1);stage.addChild(this.container);Background.prototype.setScale = function(scale) { this.container.scale.x = scale; this.container.scale.y = scale;}
  12. achexi

    SpriteSheetLoader vs AtlasLoader vs JsonLoader

    I only really use jsonloader and assetloader but ill try to give a bit of info: json loader loads json files. an example use for this could be to store level data in a json file, then to load it and a construct a level based on it. spritesheetloader loads a png sprite sheet with an accompanying json file. Its use is so that all your artwork can be stored in 1 single png instead of lots of png files. Use a tool such as texturepacker to do this. assetloader does the same as the above except I believe the differences are it also takes in single images and bitmap fonts. atlas loader does the same as the spritesheetloader but it loads atlas files instead. (could be wrong on this one, I've only ever used it for loading spine animations. In my case it does the same as the above.) This is all quite vague if you need a deeper explanation e.g. what is a json/spritesheet then feel free to ask.
  13. achexi

    Paint-like app: Graphics, interactivity and me

    You can, you first need to set your stage to interactive mode stage = new PIXI.Stage(0xFFFFFF, true) // second parameter indicates interactivitythen you can simply do: stage.mousemove = function(mouseData) { console.log("move");};you can also then bind mousedown mouseup click etc. Have a look here for a list: http://www.goodboydigital.com/pixi-js-gets-interactive/
  14. achexi

    A few simple questions

    No problem! Keep us up to date. There are quite a lot of isometric games/projects that people have posted on this forum done using pixi. It could be pretty beneficial for you to look around for some of those posts.
  15. achexi

    A few simple questions

    It is not necessary to have a DisplayObjectContainer, however the stage itself is one. It's necessary to add objects to the stage in order for them to be rendered. There are a few benefits to using containers, in my case I mostly use them to manage each screen for a game. (Loading/start/main game screens etc.) You can then add them all to your stage and filter through the visible property on them to change which one you want to show. I also tend to put these screens inside a parent container so that objects inside can all be scaled/resolution can be changed. I haven't tried Box2D with PIXI but it should work fine. As for PIXI graphics + polygon. I don't believe polygon renders to screen, I think it simply draws the shape which can then be used for things such as render to texture/collision etc. However I may be wrong on this one. But graphics will render to screen so you may want to just go with that.