-
Notifications
You must be signed in to change notification settings - Fork 439
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Debugger: add "FlxObjects-are-draggable"-mode #972
Comments
Idea : make this as a toggable feature, that would make things easier (imagine this + NAPE) |
Yeah, the idea is to add a new toggle button for this to the debugger. :) |
Will this feature be debug-mode exclusive? (I assume no, IIRC I can toggle hitbox display without enabling debug mode.) |
(ignore earlier comment) The debug drawing functionality is removed when |
FlixelCommunity/flixel#217 might be a good reference for this. |
I can work on this. I know HaxeFlixel has a way more advanced debugger than FlixelCommnity, but the plugin architecture is quite similar. I remember that everything of this feature was implemented as a plugin in Flixel Community, so maybe I could do a direct port and iterate from that. How about it? |
That seems reasonable as a starting point. Quickly glancing over that old flixel-community, I noticed you're using FlxG.mouse and keys in the plugin. Does this mean interaction doesn't work while the vcr is paused? Debugger components usually register their own Flash event listeners because of this. |
I implemented everything on the engine side avoiding whenever possible anything that was connected to Flash directly, which should help us here. The only way to stop the interaction is to prevent the As a side note, VCR was removed from the core and made a plugin in flixel-community. |
I've done the initial port and at least one tool (the pointer used to select things on the screen) is rudimentary working. I have a problem with mouse visibility though. I've tried setting Am I doing something wrong to make the mouse visible or is it a bug? EDIT: my code is here. |
Sorry for the delay!
Anyway, this code is what's interfering with it - you click the pinpoint button while hovering over the toolbar of the debugger, and when you leave that, the previous mouse state is correctly restored. You need to add some special checks to the mouse handling code in case of tool debugging I guess. I've managed to make it crash clicking on a
This was mid-state-transition. I suspect Like I suspected earlier, your approach of using Flixel events for debugging isn't viable. There's a reason (almost) everything else in the debugger uses regular Flash event: you're supposed to be able to use the debugger while the game is paused and flixel events aren't firing. |
No problem!
It seems the mouse cursor problem is a bit tricky then. I don't think adding more code to the mouse cursor logic in the engine will improve things, so I will go with a custom cursor when the draggable mode is active. I can track mouse events there and position a sprite (cursor) on the screen accordingly. I can even change the cursor to indicate that one object can be manipulated, for instance. If you disagree with that, I can add the special checks you mentioned.
Yeah, I got that a lot during development. I also think it has to do with the state change. If you make
Ok, I can easily change that. |
I've finished the port and opened the pull request 🎉 It's possible to select (multiple) objects, move and delete them. I kept the idea of a "toolbar" (at the left of the screen when the interactive debug is activated), where the user can select the tool to use. It's not perfect, but I will not invest more time on that before checking what you guys think about it. |
Very nice! |
I think that is not hard at all. Everything required to implement that is already in place, it's a matter of creating the window to show the info. |
There are tracker windows already, you would just have to open one on click. |
Yeah, seems like a very nice option: when clicking on the object, some common variables could be added to the watch window. Ideally the user would be able to customize which variables appear in the window. The draggable objects together with this and other features of the debugger would be a very powerful tool! |
Shouldn't be added to the watch window, it should create a tracker window instead. |
Remind me of this |
This should definitely be integrated into the framework imho :) |
Apparently you can do this in HaxePunk.
This would be extremely handy for UI-building and other things of that nature.
MouseEventManager
could be used for this - would need to iterate overFlxState
and add a onClick callback to everything that is aFlxObject
(MouseEventManager supporting FlxObject is useful after all, @impaler, @gamedevsam :P).The text was updated successfully, but these errors were encountered: