netcell Posted August 10, 2015 Share Posted August 10, 2015 Some weeks ago I was given a task to solve a problem with a Phaser game that it performed poorly on older devices (in this case the acient iPhone 4). The project was complicated, and some parts were very poor written, so I had a very hard time understanding it . Therefore I started to look around for some way to inspect the scene, to see what is on the screen, what is happening. The only one I found is phaser-debug. Obviously, the plugin helped me a lot with the problem, but it has its limitation. The inspection isn't realtime, which means the object list and the selected object's properties information isn't updated until I click refresh or open/close the debugging panel, which each time, reset the list and I have to find the object again and again. Not only it's inconvenient, it also doesn't allow me to understand what is really happening with the object. Therefore I created another plugin to fit my needs, based on the css style and html of phaser-debug. Currently the functionalities are:- Realtime inspection of current state.- Showing current texture of the sprite (down to the current frame)- Clickthrough toggle,- Bounds drawing (using div box).- Search (not-realtime, since the computation is too heavy). You can find a footage here on youtube. (I forgot to show the search functionalities ). As you can see, there are still a lot of css bugs, so I am gonna have to do it again. I would also add something like play/pause button and state listing and switching. I am also looking in to mobile screen simulation for the plugin too (I know how to add this but really didn't have time since I would also have to change my build process ). Anyway, with this plugin, I have solve my problem with the project and soon, I would like to release an usable plugin to everyone There is one problem that I haven't been able to solve myself :How can I make a functionality to allow me to click on the scene and get the object that I currently clicked on without actually have the on click signal dispatched? I mean, I wouldn't want to go through all the visible object and temporary disabling their handler, the developer might do something to it that interfere with this in the update during the inspection, right? Also, if you would like to have some extra functionalities in the release of this plugin, please also tell me here . I would like to look in to an add on system for this plugin but, er, I have zero experience on this . stupot, tips4design, qdrj and 3 others 6 Link to comment Share on other sites More sharing options...
Skeptron Posted August 10, 2015 Share Posted August 10, 2015 Oh my god can't wait to test that. Phaser really needs some inspection plugin of this kind Link to comment Share on other sites More sharing options...
netcell Posted August 10, 2015 Author Share Posted August 10, 2015 Oh my god can't wait to test that. Phaser really needs some inspection plugin of this kind Thank you, I hope to be able to provide an usable preview for this plugin soon. Im hoping to first complete the functionalities for the plugin and then provide a better UI I am currently quite busy with the work so it might take some time. Link to comment Share on other sites More sharing options...
netcell Posted August 14, 2015 Author Share Posted August 14, 2015 I have been able to find which sprite the pointer is currently hover over with the function processInteractiveObjects of Phaser.Pointer. However this only apply to sprite with inputEnabled = true. I wonder if there is anyway to archive the same result but also for sprite with inputEnabled = false; Link to comment Share on other sites More sharing options...
wayfinder Posted August 14, 2015 Share Posted August 14, 2015 You could perhaps update displayObject's updateTransform to check whether the mouse pointer is currently over it? Link to comment Share on other sites More sharing options...
netcell Posted August 16, 2015 Author Share Posted August 16, 2015 Doesn't that mean I would have to wrap the updateTransform function for all display objects? I actually need to find which sprite the pointer is currently over instead of if the pointer is currently over a specific sprite By the way, anyone interested in an inspector on mobile devices (remote inspection) instead of an overlay? Link to comment Share on other sites More sharing options...
wayfinder Posted August 16, 2015 Share Posted August 16, 2015 another approach: start from the top of the z-index (last drawn sprite) and check in reverse draw order whether the sprite contains the mouse pointer. that way you know you can stop looking after the first hit. Link to comment Share on other sites More sharing options...
netcell Posted August 16, 2015 Author Share Posted August 16, 2015 Since I did have my try on making my own game framework, I am aware of this method, though I just hope there are someway to avoid it since I already have a game engine runiing something guess I'll have to resolve to that solution after all. Link to comment Share on other sites More sharing options...
netcell Posted August 16, 2015 Author Share Posted August 16, 2015 Wait I didnt know Phaser have something like z-index, I'll check it out. I was abt to go from the last of the children stack haha Link to comment Share on other sites More sharing options...
Recommended Posts