Grandro Posted June 18, 2018 Share Posted June 18, 2018 I am trying to write a plugin for RPG Maker MV, which uses Pixi.js. The problem may be an incompatibility, but I have asked several people now and I just don't know where else to ask. The PIXI Version I tried it on was 4.5.4 Kreaturen.Kampfsystem.StarteKampf = function () { // Kampf Übergang for (var i = 1; i <= Kreaturen.Kampfsystem.KampfÜbergang.AnzahlFrames; i++) { Kampf_Anfang.frames.push(PIXI.Texture.fromImage(Kreaturen.Kampfsystem.KampfÜbergang.Pfad + i + '.png')); } Kampf_Anfang.anim = new PIXI.extras.AnimatedSprite(Kampf_Anfang.frames); console.log(' Kampf_Anfang.anim: ', Kampf_Anfang.anim); Kampf_Anfang.anim.animationSpeed = 0.5; Kampf_Anfang.anim.loop = false; Kampf_Anfang.anim.gotoAndPlay(0); // force reset frame Kampf_Container.addChild(Kampf_Anfang.anim); SceneManager._scene.addChild(Kampf_Container); Kampf_Anfang.anim.onComplete = function() { console.log(88888) Kreaturen.Kampfsystem.KampfAktiv = true; } } Everything works fine, the picture gets displayed but the animation just doesn't play... And because of that the .onComplete function never triggers Does anybody have an idea why this may occur? Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted June 18, 2018 Share Posted June 18, 2018 Yeah, search by "rpg maker mv" and "AnimatedSprite" in this subforum. Ask @jonforum Quote Link to comment Share on other sites More sharing options...
Grandro Posted June 18, 2018 Author Share Posted June 18, 2018 Ah, I've been in contact with him already, I guess I'll just report this issue on github then. Quote Link to comment Share on other sites More sharing options...
jonforum Posted June 18, 2018 Share Posted June 18, 2018 yes very strange , it work if we run your project on web fireFox But not in rmmv (chromium) on firefox if you add console log in AnimatedSprite.prototype.update = function update(deltaTime) { ... it will work. but with your project , if we run it in rmmv, the AnimatedSprite.prototype.update from pixi.Animation just not work, i don't know why sorry my friend. It very strange ! .onComplete() will not work because it called inside the AnimatedSprite.prototype.update Maybe you have a plugin that replace the update .. or i don't know ... hard to say.. Quote Link to comment Share on other sites More sharing options...
jonforum Posted June 22, 2018 Share Posted June 22, 2018 ok i have solution for you my friend. not sure since when, but now all animations Sprites also include Video elements need to hack update. I don't know if it chromium and node js or the new rmmv core 1.6.1 , but pixi tikers not seem scoped animore to the update. Need to do it manually. PIXI.loader .add('titleScene/bgsTextCommands.json') .load(onAssetsLoaded); function onAssetsLoaded(){ // create an array of textures from an image path var frames = []; for (var i = 0; i < 15; i++) { var val = i < 10 ? '0' + i : i; frames.push(PIXI.Texture.fromFrame('bgTextCommand_000' + val )); }; // here the way // create a container and animation sprite var aniContainer = new PIXI.Container(); var aniSprite = new PIXI.extras.AnimatedSprite(frames); aniContainer.addChild(aniSprite); // hack update tiker (rmmv chromium seem not take anymore the core shared tiker, i don't know why) // you need to scope the tikers or force a default value. aniContainer.update = function(detla=1){ aniSprite.update(detla); } // add container to rendered screen SceneManager._scene.children[0].addChild(aniContainer); } also @ivan.popelyshev i you have any idea why it look like that now !, am interested to know note if we force run project on firefox it working no need hack !! But in rmmv, with chromium and nwjs, we need manually hack. Quote Link to comment Share on other sites More sharing options...
jonforum Posted June 22, 2018 Share Posted June 22, 2018 so maybe try this , sorry am poor in german or russian // hack update Kampf_Container�.update = function(detla){ Kampf_Anfang.anim.update(1); Quote Link to comment Share on other sites More sharing options...
Grandro Posted June 22, 2018 Author Share Posted June 22, 2018 @jonforum Thank you alot dude! I will try it out in the next days/week and tell you whether it worked out Quote Link to comment Share on other sites More sharing options...
jonforum Posted June 25, 2018 Share Posted June 25, 2018 On 6/22/2018 at 4:20 PM, Grandro said: @jonforum Thank you alot dude! I will try it out in the next days/week and tell you whether it worked out I completely forgot that I removed it every time . this plugin added by the Kadokawa team is demonic. he was crushing the pixi.Tiker for update animation in the core remove <script type="text/javascript" src="js/libs/fpsmeter.js"></script> and disable in the core , and pixi will work without hack Graphics._createAllElements = function() { this._createErrorPrinter(); this._createCanvas(); this._createVideo(); this._createUpperCanvas(); this._createRenderer(); //this._createFPSMeter(); this._createModeBox(); this._createGameFontLoader(); }; Grandro 1 Quote Link to comment Share on other sites More sharing options...
Grandro Posted June 26, 2018 Author Share Posted June 26, 2018 @jonforum Works like a charm! Thank you so much, I owe you something Have a nice day! 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.