Log In  

Cart #26505 | 2016-08-05 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA

Cart #26285 | 2016-08-01 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA

Cart #26253 | 2016-08-01 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA

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.

P#26254 2016-08-01 05:08 ( Edited 2016-08-08 05:00)

it looks nice, well done Juju

P#26274 2016-08-01 16:16 ( Edited 2016-08-01 20:16)

yeah, it doesn't work for me. (using firefox)

P#26276 2016-08-01 17:12 ( Edited 2016-08-01 21:12)

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.

P#26287 2016-08-01 18:44 ( Edited 2016-08-01 22:45)

you might be using _update60(), while the player only knows about _update() right now...

P#26288 2016-08-01 18:51 ( Edited 2016-08-01 22:51)

That might indeed be why.

P#26293 2016-08-01 21:01 ( Edited 2016-08-02 01:01)

I have something like this that isn't finished. Very similar. I should probably upload it so we can compare/share ideas.

P#26349 2016-08-02 18:14 ( Edited 2016-08-02 22:19)

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()
P#26350 2016-08-02 18:18 ( Edited 2016-08-02 22:18)

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.

P#26506 2016-08-05 01:50 ( Edited 2016-08-05 05:57)

Only 2 stars for this wonder, it's a real shame!

P#26512 2016-08-05 04:50 ( Edited 2016-08-05 08:50)

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.

P#26513 2016-08-05 06:21 ( Edited 2016-08-05 10:22)

Looking awesome! I would suggest having the cursor change when the mouse is over an edge and can be dragged.

P#26516 2016-08-05 09:01 ( Edited 2016-08-05 13:01)

The start of a pico8 OS? ;) seconded @Ivoah's comment.
Pretty neat stuff.

P#26517 2016-08-05 10:03 ( Edited 2016-08-05 14:03)

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):

P#26524 2016-08-05 12:43 ( Edited 2016-08-05 16:44)

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... ;)

P#26535 2016-08-05 15:58 ( Edited 2016-08-05 20:04)

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.

P#26571 2016-08-06 01:57 ( Edited 2016-08-06 05:57)

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

P#26654 2016-08-08 01:00 ( Edited 2016-08-08 05:00)

[Please log in to post a comment]