brdmg Posted September 19, 2016 Share Posted September 19, 2016 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. Quote Link to comment Share on other sites More sharing options...
Exca Posted September 19, 2016 Share Posted September 19, 2016 The easiest way is to have 2 movieclips on top of eachother in one container. Then you would just create 2 movieclips like you've done above. Quote Link to comment Share on other sites More sharing options...
alex_h Posted September 19, 2016 Share Posted September 19, 2016 One way of combining two textures is to draw them to a render texture. You should then be able to use the render texture as one of the textures for the movie clip. Quote Link to comment Share on other sites More sharing options...
xerver Posted September 19, 2016 Share Posted September 19, 2016 Draw each image to a canvas element, use the canvas element as a texture. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.