brdmg

Members
  • Content Count

    9
  • Joined

  • Last visited

  1. can you suggest me best alternative for movieclip to use it until releasing onUpdate. I dont know actually whether MovieClip is best way for creating animations.
  2. But how can i control that if i use somemovieclip.play()
  3. Is there a way to position every frame with different positions in MovieClip in case where frames are different sizes. As much as I explored, I couldn't find a way, because frames created with new PIXI.Rectangle have only x,y (which is frame position on spritesheet) and width and height.
  4. function createFrames(data) { var frames = []; for(var k=0; k<20; k++) { frames.push(new PIXI.Texture(PIXI.loader.resources['image1.png'].texture.baseTexture, new PIXI.Rectangle(firstFrames[data + k][2], firstFrames[data + k][3], firstFrames[data + k][0], firstFrames[data + k][1]))); } } This is basic way for creating frames for MovieClip from one texture and one spritesheet json. Is there any way to combine two textures to get one frame in which one texture lays on top of the another.
  5. Sorry, i pasted wrong line, its container.appendChild(renderer.view). Everything works fine with Container but error occurs with ParticleContainer.
  6. my code is pretty straightforward so I'll write in short lines var renderer = new PIXI.autoDetectRenderer(300, 300, {transparent: true}); var stage = new PIXI.ParticleContainer(5000, {uvs: true}); stage.appendChild(renderer.view); then i load assets and create MovieClip object and append it to stage function createAnimation() { var frames = []; for(var i=75; i<150; i++) { frames.push(new PIXI.Texture(resources.texture, new PIXI.Rectangle(imgData[2],imgData[3], 238, 235))); //imgData is json with frames positions } return new PIXI.extras.MovieClip(frames); } So, i traced call stack and came up with this -It starts from WebGLRenderer.prototype.render if(!skipUpdateTransform) { // update the scene graph var cacheParent = displayObject.parent; displayObject.parent = this._tempDisplayObjectParent; displayObject.updateTransform(); displayObject.parent = cacheParent; // displayObject.hitArea = //TODO add a temp hit area } ParticleContainer.prototype.updateTransform = function () { // TODO don't need to! this.displayObjectUpdateTransform(); // PIXI.Container.prototype.updateTransform.call( this ); }; DisplayObject.prototype.updateTransform = function () { this.transform.updateTransform(this.parent.transform); // error // multiply the alphas.. this.worldAlpha = this.alpha * this.parent.worldAlpha; this._bounds.updateID++; }; Maybe I'm using wrong way for creating MovieClip?
  7. Recently I've been developing small app for raspberry pi with few sets of sprites. I used PIXI.Container as stage for rendering with MovieClip objects inside of it. And it works fine. Then I tried to improve perfomances and changed PIXI.Container to PIXI.ParticleContainer(5000, {uvs: true }); It works fine on pc, but on pi i get error "TypeError: null is not an object (evaluating 'this.parent.transform')" which occurs in this part of pixi DisplayObject.prototype.updateTransform = function () { this.transform.updateTransform(this.parent.transform); // multiply the alphas.. this.worldAlpha = this.alpha * this.parent.worldAlpha; this._bounds.updateID++; }; I tested this part and it's used by PIXI.ParticleContainer and not PIXI.Container and i was wondering can i somehow avoid using this part of code
  8. Thank you for fast reply. I'll try with creating all base textures after loading assets.
  9. Is there any way for using one MovieClip object for few animations. If I have function which creates frames named "createFrames()", in first step I would do var animation = new PIXI.extras.MovieClip(createFrames()); So if somewhere in code I need animation with different frames, can I do something like animation = createFrames(); Just create new frames and add it to movieclip object which was created before. I tried with animation._textures = createFrames() , but it's not working. Why this question. Well I thought maybe it'll be better for performance if I avoid creating new MovieClip everytime I need new animation, and it's very often, every few seconds.