PhaserEditor2D Posted February 12, 2016 Share Posted February 12, 2016 Hi, This is something that many of you are requesting for a while: an auto-completion plugin for Sublime Text. Checkout it: https://github.com/boniatillo-com/PhaserSublimePackage It was tested on Sublime Text 2 and 3, I just released it so if you have any issue put a comment here or open an issue in github. This is something nice to do while we wait for the next Phaser release to deliver a Phaser Editor update ;-) Remember Phaser Editor is a very nice complement to Sublime Text. Have fun coding! fillmoreb, GrimPanda, WombatTurkey and 1 other 4 Link to comment Share on other sites More sharing options...
fillmoreb Posted February 12, 2016 Share Posted February 12, 2016 I'll be trying this out today. Thanks! PhaserEditor2D 1 Link to comment Share on other sites More sharing options...
PhaserEditor2D Posted February 12, 2016 Author Share Posted February 12, 2016 Hehe oh god! Git ignored the whole node_modules! Pushing them.... Link to comment Share on other sites More sharing options...
fillmoreb Posted February 12, 2016 Share Posted February 12, 2016 Unfortunately, I can't install this. When I try, phaser has the following error: plugin_host has exited unexpectedly, plugin functionality won't be available until Sublime Text has been restarted This error persists through restarting sublime. Sublime Text Stable Channel, Build 3103 *** EDIT *** NINJA'D, I'll try it with the new push. Link to comment Share on other sites More sharing options...
PhaserEditor2D Posted February 12, 2016 Author Share Posted February 12, 2016 Just now, fillmoreb said: Unfortunately, I can't install this. When I try, phaser has the following error: plugin_host has exited unexpectedly, plugin functionality won't be available until Sublime Text has been restarted This error persists through restarting sublime. Sublime Text Stable Channel, Build 3103 Please wait a bit, as I said, I am pushing lot of code that was ignored by git. Link to comment Share on other sites More sharing options...
PhaserEditor2D Posted February 12, 2016 Author Share Posted February 12, 2016 Done! I uploaded the missing files. Please update it and test again. Link to comment Share on other sites More sharing options...
dimayak Posted February 12, 2016 Share Posted February 12, 2016 Works like a charm, thanks. Are you going to add https://packagecontrol.io/ support for your plugin? It would be awesome to be able to install your package automatically Link to comment Share on other sites More sharing options...
fillmoreb Posted February 12, 2016 Share Posted February 12, 2016 This is awesome. It's working now that I got those updated files. A couple questions: Is there a way to get the autocomplete to indicate a bit more visibly which things are properties and which are methods? Right now a method looks like this: add (child,silent) and a property looks like: alive (bool). It would be cool if properties displayed more like alive:bool. It would be easier to tell at a glance what is what. Also, while playing around, I noticed that Phaser.Group didn't have the scale property available in the autocomplete. How would I go in to add missing properties? Thanks again for the great plugin. PhaserEditor2D 1 Link to comment Share on other sites More sharing options...
PhaserEditor2D Posted February 12, 2016 Author Share Posted February 12, 2016 Done. I updated the Phaser definitions with the last changes from Rayo. And the completions now have a difference between properties and methods. fillmoreb 1 Link to comment Share on other sites More sharing options...
WombatTurkey Posted February 12, 2016 Share Posted February 12, 2016 Haha, this is great. Maybe it's finally time for me to move away from Notepad++ NOW! This is a perfectly valid reason eh?! Also, how did you get a light skin on sublime? I always hated the dark skin one, which was why I never really made the switch. I like the clear / white notepad ++ feel. Link to comment Share on other sites More sharing options...
minhaz1217 Posted February 13, 2016 Share Posted February 13, 2016 Hello, this is a great plugin , I would like to use it. But I'm having some problem. My basic project template is that I make 1 my game object like CTB. Then I make other objects like "Boot", "Preload", "Menu", "Game", "Ending" etc from the CTB object. And different preload, create, update inside those objects.I also put "Boot", "Preload", "Menu", "Game", "Ending" etc in different files and put them together in the index.html file. Here is an example of my object creation. CTB.Loader = function(game){}; CTB.Loader.prototype ={ preload: function(){ this.add.sprite(0,0, "banana"); }, create: function(){ this.state.start("Menu"); } //use update: function(){} if needed }; the problem is that when I try to use the code hinting inside any of the preload, create, update function I don't get any.hinting. Is there anyway for me to solve this? The hinting works when I try to use it like this CTB = {}; CTB.test = function(){} CTB.test.prototype = Object.create(Phaser.State.prototype); CTB.test.prototype.constructor = CTB.test; CTB.test.prototype.create = function(){ } But not like this CTB = {}; CTB.test = function(){} CTB.test.prototype = Object.create(Phaser.State.prototype); CTB.test.prototype.constructor = CTB.test; CTB.test.prototype = { create: function(){ } }; I'm new to phaser and javascript as a whole. I have no idea why this is happening. I have many projects already created, I would like to use the hinting in those. how can I add the hinting to my projects. thanks in advance if you reach this far =). Link to comment Share on other sites More sharing options...
PhaserEditor2D Posted February 13, 2016 Author Share Posted February 13, 2016 8 hours ago, WombatTurkey said: Haha, this is great. Maybe it's finally time for me to move away from Notepad++ NOW! This is a perfectly valid reason eh?! Also, how did you get a light skin on sublime? I always hated the dark skin one, which was why I never really made the switch. I like the clear / white notepad ++ feel. The theme of the screenshots is iPlastic, go to Preferences > Color Scheme > iPlastic I love notepad++ too, it is so fast! I am sure that you can find a theme like notepad++ in sublime, even it should no be to hard to create it yourself :-) WombatTurkey 1 Link to comment Share on other sites More sharing options...
PhaserEditor2D Posted February 13, 2016 Author Share Posted February 13, 2016 @minhaz1217 The problem is that in the first case it is not working to you, the inference engine has no way to know that you are creating a "sub-class". In JavaScript the inheritance is expressed like you do in the second snippet. JavaScript is very flexible, but if you like content assist you have to follow certain rules, for example, annotating method parameters with jsdoc tags etc... Link to comment Share on other sites More sharing options...
Fábio Colombini Posted June 25, 2016 Share Posted June 25, 2016 Hi, I´ve installed following this installation guide: cd /path/to/sublime-text-N/Packages git clone git://github.com/ternjs/tern_for_sublime.git cd tern_for_sublime npm install But it´s not working. Any help? Link to comment Share on other sites More sharing options...
PhaserEditor2D Posted June 25, 2016 Author Share Posted June 25, 2016 Please follow the steps here: https://github.com/boniatillo-com/PhaserSublimePackage#installation You are cloning the ternjs repo, not the PhaserSublimePackage repo. Link to comment Share on other sites More sharing options...
skinwalker Posted August 24, 2016 Share Posted August 24, 2016 When I add phaser.js to my project the auto-completion doesn't work. As soon as I start typing the error pops up saying "Failed to start server C:/wamp64/www/MyTestProject/phaser.js:3081... " If I get rid of the phaser.js file it is working, but then I cannot start my project, it shows a blank page. Any idea how to fix that ? Link to comment Share on other sites More sharing options...
PhaserEditor2D Posted August 25, 2016 Author Share Posted August 25, 2016 Hi @skinwalker The package uses ternjs so your `.tern-project` file is your best friend. You can read how to configure it here: http://ternjs.net/doc/manual.html#configuration Try by changing the `.tern-project` file like this: { "libs": ["browser"], "plugins" : { "phaser" : {}, "doc_comment": {} }, "dontLoad" : ["lib/phaser.js"] } Link to comment Share on other sites More sharing options...
skinwalker Posted August 25, 2016 Share Posted August 25, 2016 This doesn't resolve the issue. If I move the phaser.js file in another directory or just delete it, the plugin works fine, but then I cannot start my project Here is a screenshot of the error, I am getting as soon as I start typing, when I have phaser.js in my directory : Link to comment Share on other sites More sharing options...
PhaserEditor2D Posted August 25, 2016 Author Share Posted August 25, 2016 It seems that keeps looking into phaser.js. I just can recommend to start a new project and do it again. Link to comment Share on other sites More sharing options...
skinwalker Posted August 25, 2016 Share Posted August 25, 2016 1 hour ago, Arian Fornaris said: It seems that keeps looking into phaser.js. I just can recommend to start a new project and do it again. I have tried multiple times with no result Link to comment Share on other sites More sharing options...
PhaserEditor2D Posted August 25, 2016 Author Share Posted August 25, 2016 Well... I don't know what could be the problem. The only thing I can do for you is to test your project here in my machine. Link to comment Share on other sites More sharing options...
skinwalker Posted August 25, 2016 Share Posted August 25, 2016 6 minutes ago, Arian Fornaris said: Well... I don't know what could be the problem. The only thing I can do for you is to test your project here in my machine. There is nothing specific in the project, just a javascript file + phaser + .tern file. Can you show me how your project's structure looks like ? Also, what I did is just followed these 7 steps from the github link, I haven't installed anything else. Link to comment Share on other sites More sharing options...
PhaserEditor2D Posted August 25, 2016 Author Share Posted August 25, 2016 Yes, I was able to reproduce the error. The "dontLoad" is not working, please can you open an issue in github? https://github.com/boniatillo-com/PhaserSublimePackage/issues As work around you can rename `phaser.js` to `phaser.min.js` it worked for me. Link to comment Share on other sites More sharing options...
skinwalker Posted August 25, 2016 Share Posted August 25, 2016 39 minutes ago, Arian Fornaris said: Yes, I was able to reproduce the error. The "dontLoad" is not working, please can you open an issue in github? https://github.com/boniatillo-com/PhaserSublimePackage/issues As work around you can rename `phaser.js` to `phaser.min.js` it worked for me. Thanks man, it also works for me !! I opened an issue in github. So what is the difference between phaser.js and phaser.min.js ? Link to comment Share on other sites More sharing options...
PhaserEditor2D Posted August 25, 2016 Author Share Posted August 25, 2016 It seems that ternjs ignores *.min.js files by default. Thanks for opening the issue. skinwalker 1 Link to comment Share on other sites More sharing options...
Recommended Posts