Jump to content
This forum will be closing down. Please move to the respective dedicated project forums.

[WIP] Phaser Inspector Plugin


netcell
 Share

Recommended Posts

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  :wacko: . 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 :P ). 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 :blink: :

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  :D . I would like to look in to an add on system for this plugin but, er, I have zero experience on this  :lol: .

Link to comment
Share on other sites

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. :D

Link to comment
Share on other sites

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

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

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...