Quick thing I made with the, ahem, undocumented mouse feature, dunno if it's been done before, but here's my take on a stacking window manager I coded in, like, less than an hour?
- You can drag and drop windows
- Active window goes on front
- Each window has its own update/draw function, clip'd and camera'd to the window
I wanted to post this before going to sleep, but here's what's probably next:
- Resizing windows
- Title bars
- Input to the active window
- Task bar and desktop icons
Well, hope you like it. It's pretty much a multitasking OS in PICO-8 we have here.
P.S.: Since it uses the undocumented mouse feature, it may or may not work on anything other than the desktop version. You've been warned.
Thanks! Kinda weird it doesn't work on mine (using Chrome, not working either), I saw it working on other cartridges. It does work on desktop, though.
Anyway, update 0.2: GUI code is in a separate module, added title bars and resizing.
you might be using _update60(), while the player only knows about _update() right now...
I have something like this that isn't finished. Very similar. I should probably upload it so we can compare/share ideas.
There's a bug in the web player at the moment where it ignores _update60. You can add this and it'll work right in both environments:
function _update() _update60() _update_buttons() _update60() end |
Hey, thanks, it worked.
So yeah, the library is mostly done and everything that is supposed to work should work, see for yourself. Feel free to use it in your apps! It has some nice API I should probably document, anyway, have fun with it. What's next, controls and stuff?
Added a taskbar and the usual 3 minimize/maximize/close buttons, and the window object (that you should use as the parameter of the window update/draw functions) exports its own input functions that will only work on the current focused window. That and a few other nice functions. Oh, and the Enter menu, it makes for a nice start menu.
Yeah, I should really document everything.
This is seriously good!
A quirk: when reducing size of window by resizing, I think it should be limited to the location of the opposite side of the window. Maybe even limited to width of widgets away from left side of window?
Right now, you can resize it past the opposite edge and a slither of window moves across the screen.
Looking awesome! I would suggest having the cursor change when the mouse is over an edge and can be dragged.
The start of a pico8 OS? ;) seconded @Ivoah's comment.
Pretty neat stuff.
It's very good this way...
Like above, a cursor change would make resizing windows easier. Also I think it could also start dragging when you select the inner pixel delimitated by the window border (so it would be 2 pixels wide/high and would be easier to select).
I've made a variation, with icons more like win95 (I've moved a bit the buttons, they are 9 px wide instead of 8 pixels):
great work!
a few suggestions:
-crop the windows titles (or have opaque buttons drawn over)
-avoid 3d buttons, the windows look slick, the taskbar not so much
-the taskbar seems buggy,clicking buttons should only focus the corresponding window. also have the taskbar buttons reflect the focus
-the colored window buttons don't talk for themselves, I've tried a white dot/square/cross combo, looks better.
-make a start menu (pico logo?), the console menu is not mouse driven, breaks immersion
-the pointer hotspot should be on the topmost white pixel (imho)
-use the gamepad too!
- +1 on what everybody said!
oh, and buttons,radios,sliders, color-pickers...
and drop-down menus, tabs... ;)
Thanks for the suggestions, +1 to what everybody said and changed. There's some stuff that are deliberate and/or known issues, I'll work on that :)
@matt, that's kind of deliberate... yeah, could change it so it stops instead of moving the window.
@Ivoah, thought of that too, but right now I'd have to add some more spaghetti to my code to do that.
@farvardin, I do like the new buttons, it addresses a few of @ultrabrite's concerns. The console menu is kind of a stand-in to the start menu, actually. The gamepad is indeed used, look at "Program 1", start a few of them, the gamepad buttons are sent to the focused window... unless the mouse can be driven with the gamepad too, except the windows would only receive mouse events.
Anyway, there's quite a few stuff to improve here, and I'm taking all of this in consideration.
I really like PicoWm so far, @Juju.
I want to help out, so I took a jab editing the UI to be better (or at least more to my personal preferences :P):
The UI changes are skin deep, and not (yet) functional.
I kinda aimed for a windows 3.1/10 look, along with a pico-8 start menu thing.
I also changed which pixel on the mouse "clicks", if you can tell.
Hopefully, as I learn to understand the code better I'll be able to help tweak the infrastructure too. :)
[Please log in to post a comment]