Sebi Posted October 7, 2014 Share Posted October 7, 2014 Hello Guys, I'm currently working on this plugin for PIXI: http://mokgames.com/playground/pixi.dom/ Those input elements are actual Sprites. See also: http://www.html5gamedevs.com/topic/9668-pixi-input-elements/ I have never written a plugin for Phaser, but I believe that it is pretty easy to port it. So I'm curious if anyone is interested to have those ported or not. If yes, then I will publish a Phaser port too. It will probably take a few more days until I have implemented all the things that I have in my mind. So, does anyone want this to be usable with Phaser? Cheers austin and oddskill 2 Link to comment Share on other sites More sharing options...
lewster32 Posted October 7, 2014 Share Posted October 7, 2014 That's very cool - especially as it seems to support full editing, selection, clipboard etc. Impressive stuff! Link to comment Share on other sites More sharing options...
CtlAltDel Posted October 7, 2014 Share Posted October 7, 2014 Got the code for the PIXI stuff up on github somewhere? I am willing to assist converting this to a Phaser plugin. I require a name input for a player and this would be perfect since it supports bitmap fonts Link to comment Share on other sites More sharing options...
Sebi Posted October 7, 2014 Author Share Posted October 7, 2014 Thanks lewster! I'm doing this by having 1 real input field set to opacity 0, width 1px, height 1px positioned outside of the screen. When you select an input sprite, then the hidden input tag gets focused and it's content gets set to the sprites input values. That way all shortcuts e.g. ctrl+c, ctrl+x, etc, work like a charm and it's really easy to just grab the cursor position by the inputs selectionStart/selectionEnd values. There are still some bugs and probably a lot to optimize tho. I hope it won't be too hard to port this to Phaser and I have no idea for the namespace yet. In my PIXI version I use: PIXI.InputObject (inherit from PIXI.Sprite) PIXI.ButtonFactory(this draws the background for the sprite) PIXI.Button (inherit from PIXI.InputObject) PIXI.Input (inherit from PIXI.InputObject) PIXI.Select (inherit from PIXI.InputObject) There will most likely also be PIXI.Checkbox and PIXI.Radio, those are like the easiest elements (just a sprite changing texture on checked/unchecked) I'm not sure yet how hard it would be to also create an PIXI.Textarea, this mostly because of the scrollbars. Other than that, There could also be PIXI.ScrollableContainer. Any suggestion for a good namespace when using this with Phaser? I haven't looked it up yet, so I can't tell what I can use and what I should use. I don't want to conflict with future Phaser releases either. @CtlAltDel Not on GitHub yet. I don't want anyone to grab a half finished plugin. Link to comment Share on other sites More sharing options...
CtlAltDel Posted October 7, 2014 Share Posted October 7, 2014 I suggest Phaser.Interactive.* ? Link to comment Share on other sites More sharing options...
oddskill Posted October 7, 2014 Share Posted October 7, 2014 Great work.+1 for Phaser port regards oddskill Link to comment Share on other sites More sharing options...
Recommended Posts