LinkTree Posted August 27, 2015 Share Posted August 27, 2015 Hi, I converted the pixi.js canvasTinter class to a plugin for panda.js. You can find it here:https://github.com/LinkTree3/Panda.js-plugins zakhov 1 Quote Link to comment Share on other sites More sharing options...
Ninjadoodle Posted August 27, 2015 Share Posted August 27, 2015 Hey LinkTree This looks cool Thank you! Will it work with 2.0? Quote Link to comment Share on other sites More sharing options...
Legomite Posted August 28, 2015 Share Posted August 28, 2015 This is really awesome looking! Just what I was looking for! Quote Link to comment Share on other sites More sharing options...
LinkTree Posted August 28, 2015 Author Share Posted August 28, 2015 Hey LinkTree This looks cool Thank you! Will it work with 2.0?Yep it is based on 2.0. I didn't try it in 1.3 though. Quote Link to comment Share on other sites More sharing options...
zakhov Posted September 1, 2015 Share Posted September 1, 2015 Nice work dude! Does this work with Animated sprites and bitmap text as well?EDIT: It seems like with Animation, the sprites flicker. Not working with text on my end so far.But it's working great with normal sprite images! Quote Link to comment Share on other sites More sharing options...
LinkTree Posted September 1, 2015 Author Share Posted September 1, 2015 Nice work dude! Cheers!Thanks, I just updated it to include particle textures as well as an easier setting of the tintMethod. Quote Link to comment Share on other sites More sharing options...
Ninjadoodle Posted September 2, 2015 Share Posted September 2, 2015 Hi @LinkTree I've been playing with the sprite tinter and for some reason, when I try to follow the instructions to set the 'tint' of my sprite, it just becomes invisible. Not sure if I'm doing something wrong, but I can't seem to get it working Thanks in advance! Quote Link to comment Share on other sites More sharing options...
LinkTree Posted September 2, 2015 Author Share Posted September 2, 2015 Can you show me a code example of what you tried? Quote Link to comment Share on other sites More sharing options...
LinkTree Posted September 2, 2015 Author Share Posted September 2, 2015 Hi @LinkTree I've been playing with the sprite tinter and for some reason, when I try to follow the instructions to set the 'tint' of my sprite, it just becomes invisible. Not sure if I'm doing something wrong, but I can't seem to get it working Thanks in advance! Ok I think I found the reason your textures were not showing. you are working with a tablet or a smartphone with high resolution I fixed this issue in the latest update. you can try it now. Quote Link to comment Share on other sites More sharing options...
Ninjadoodle Posted September 3, 2015 Share Posted September 3, 2015 Hi @LinkTree Thanks for the quick reply, but I still can't get it to work. The only code I have is this ... to require ... .require( 'plugins.spriteTinter', and when creating the sprite ... var lightSwitch = new game.LightSwitch(240, 212, this.bg);lightSwitch.tint = "#FF0000"; The lightswitch works fine without the tint, but when when the tint is added, it becomes invisible. Hope this helps Quote Link to comment Share on other sites More sharing options...
LinkTree Posted September 3, 2015 Author Share Posted September 3, 2015 Hi @LinkTree Thanks for the quick reply, but I still can't get it to work. The only code I have is this ... to require ... .require( 'plugins.spriteTinter', and when creating the sprite ... var lightSwitch = new game.LightSwitch(240, 212, this.bg);lightSwitch.tint = "#FF0000"; The lightswitch works fine without the tint, but when when the tint is added, it becomes invisible. Hope this helps is game.LightSwitch a class extended from game.Sprite? Quote Link to comment Share on other sites More sharing options...
Ninjadoodle Posted September 3, 2015 Share Posted September 3, 2015 Hmmmm ... that could be it! It's extended from game.Animation Any way to get it going with anims? Thanks for spotting that! Quote Link to comment Share on other sites More sharing options...
LinkTree Posted September 3, 2015 Author Share Posted September 3, 2015 Hmmmm ... that could be it! It's extended from game.Animation Any way to get it going with anims? Thanks for spotting that! Hmmm... I just tried it with a game.Animation and it worked fine. did you override the default rendering of game.Animation with game.LightSwitch? this worked for me:var anim = new game.Animation(['eye.png','eye2.png']);anim.play();anim.tint = "#ff0000";anim.addTo(game.scene.stage);Edit:I haven't seen your game.LightSwitch code but my assumption is that the problem might be in it's init function. Quote Link to comment Share on other sites More sharing options...
Ninjadoodle Posted September 3, 2015 Share Posted September 3, 2015 This is all I have in my LightSwitch class ...game.createClass('LightSwitch', 'Animation', { textures: ['lightSwitch0001.png', 'lightSwitch0002.png', 'lightSwitchInvisible.png'], interactive: true, buttonMode: true, init: function(x, y, container) { this.anchor.set(this.width/2, 0); this.position.set(x, y); this.addTo(container); this.off = true; },});and then to put in on screen ...var lightSwitch = new game.LightSwitch(240, 212, this.bg);lightSwitch.tint = "#FF0000";Hmmm ... I might very well be doing something wrong. I'll see if I can get it going haha. Thank for your help Quote Link to comment Share on other sites More sharing options...
LinkTree Posted September 3, 2015 Author Share Posted September 3, 2015 This is all I have in my LightSwitch class ...game.createClass('LightSwitch', 'Animation', { textures: ['lightSwitch0001.png', 'lightSwitch0002.png', 'lightSwitchInvisible.png'], interactive: true, buttonMode: true, init: function(x, y, container) { this.anchor.set(this.width/2, 0); this.position.set(x, y); this.addTo(container); this.off = true; },});and then to put in on screen ...var lightSwitch = new game.LightSwitch(240, 212, this.bg);lightSwitch.tint = "#FF0000";Hmmm ... I might very well be doing something wrong. I'll see if I can get it going haha. Thank for your help this worked for me:game.createClass('Anim','Animation',{ textures: ['eye.png', 'eye2.png'], interactive: true, buttonMode: true, init: function(x, y, container){ this.anchor.set(this.width/2, 0); this.position.set(x, y); this.addTo(container); this.off = true; }});var anim = new game.Anim(100,100,game.scene.stage);anim.tint = "#ff0000";anim.play();Maybe it is something else that causes it. are you getting any errors in your console? Quote Link to comment Share on other sites More sharing options...
Ninjadoodle Posted September 3, 2015 Share Posted September 3, 2015 Now that you say so ... I am. I completely forgot to check (as everything else was working). [Error] TypeError: undefined is not an object (evaluating 'game.FastContainer.inject')(anonymous function) (spriteTinter.js, line 334)_loadModules (core.js, line 712)_loadModules (core.js, line 720)body (core.js, line 260)global code (sprite.js, line 10) Quote Link to comment Share on other sites More sharing options...
LinkTree Posted September 3, 2015 Author Share Posted September 3, 2015 Now that you say so ... I am. I completely forgot to check (as everything else was working). [Error] TypeError: undefined is not an object (evaluating 'game.FastContainer.inject')(anonymous function) (spriteTinter.js, line 334)_loadModules (core.js, line 712)_loadModules (core.js, line 720)body (core.js, line 260)global code (sprite.js, line 10) Are you using the 2.0 version? I am not sure but I think the first error is due to game.FastContainer not existing and it indeed doesn't exist in the 1.3 version. Quote Link to comment Share on other sites More sharing options...
Ninjadoodle Posted September 3, 2015 Share Posted September 3, 2015 Yup definitely 2.0 I think I'm using yesterdays update. Quote Link to comment Share on other sites More sharing options...
LinkTree Posted September 3, 2015 Author Share Posted September 3, 2015 Yup definitely 2.0 I think I'm using yesterdays update. Hmmm... I just updated to the latest panda version and everything works. I am not sure what could be causing this... can you please create a working example representing the issue? Quote Link to comment Share on other sites More sharing options...
Ninjadoodle Posted September 3, 2015 Share Posted September 3, 2015 I'm going to strip what I'm doing down a bit and send you a Dropbox link tonight Thanks heaps for looking into this! Quote Link to comment Share on other sites More sharing options...
LinkTree Posted September 3, 2015 Author Share Posted September 3, 2015 I'm going to strip what I'm doing down a bit and send you a Dropbox link tonight Thanks heaps for looking into this!Alright. And you're welcome! 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.