May I ask if you have a minute or ten for me?
Displaying 21-28 of 28 total.
prev 1 2
Please enter a numerical value for the importance of this sticky.
Enter 0 to unsticky.
Buckermann

Quote:Originally posted by Omni


Okay, I've tried it. Your window focusing is amazing.

Amazing? Gimme some of that stuff you are smoking!
It's rather simple. I just keep a table of open windows, let's say "2,5,10,1,3" (from botton to top). If I want to make a window active, let's assume window 10, I just close all windows untill I reach my number, move the windows above 10 one place down in the list, move window 10 to the end of the list, and simply redraw all windows starting from window 10 previous position till I reach the end.

One minor thing: mouse/window collision seems to be based on the entire mouse rectangle. This means that even if a Window is protruding from beneath another, unless the entire mouse rect can fit inside the rect, you can't focus the window. In my system I use check for a 1-pixel wide rectangle at the top-left pixel coordinate of the mouse.

Not quite. I too use only a one pixel detection. The problem is that my windows are made of a template like this:

While this allows for nice customization, it also creates a invicible frame around the window (the magenta colours which are not drawn). But with a little bit of luck, and some hard thinking, I should be a able to solve this.
But only after the battle system contest

About general speed issues:
The window drawing itself is rather fast, thanks to V3s overall speed. My windows are simple images (or rather two images, one for the frame and one for the body). When a window is moved, I have to blit three images.
1. Restore image (which holds the space under the window before the window was drawn)
2. The Window Body (with text, images or simply the empty body)
3. The Window Frame.
These three images are only altered if something happens with the window. Like resizing or altering the body content. And that is pretty fast too (again, thanks to V3s speed), except for text-wordwrapping. I don't think it would speed up the program if I would skip this too. But if I find the time, I'll try it. Even if it's just to satisfy my curiousity.

Posted on 2004-06-03 15:31:45

Alex

Buckermann, your webspace is terribly unfriendly. Good thing it supports resuming, because it would only let me download 14% of the file at a time!

Still, I persisted and I'm glad. That's some impressive mousy-windowy stuff you've got going on there. Runs fine on my 1.4ghz, even maxed. And ... pressing ALT makes it do weird stuff!

One thing I don't think anyone's mentioned (a slap on the wrist for me if they have), the window titles are drawn slightly outside of the titlebars, until you actually click on the titlebar, at which point it moves into the correct position. Then it moves back outside the window when you either activate another window, or click in the main body of the same window. A minor thingy though, well done sir!

Posted on 2004-06-03 20:05:40

Omni

Smoking? Well, let's just say I was frustrated enough trying to get my own Window detection working.

The way I do it, is I keep a sequence of all window objects, and I have a global "focused_window" variable. I update the Mouse for each window, backwards.

I.e., the most recent window is updated first, then the others. If a window gains the mouse focus, it is removed from the Window sequence, appended to the end of the window sequence, and set as the "focused_window."

Then, when it's render time, I draw all windows in their sequence order. Since the most recently focused window is last, that means the last window I clicked on is rendered last, which means it's on top of everything else. I then give keyboard input to the "focused_window" for stuff like a textbox and a listbox.

Having your windows made of a collection of pieces means that you can customize the sizes--that's a really neat thing you did. Also, I can see how you keep track of all the windows now --using a numerical list. Very smooth.

Posted on 2004-06-03 22:47:52

Buckermann

Quote:Originally posted by Alex

Buckermann, your webspace is terribly unfriendly. Good thing it supports resuming, because it would only let me download 14% of the file at a time!

I'm searching for a new free host right now. The last host deleted all files during a server upgrade. My host before that went out of business. Another host switched to paid accounts only. While freenet may not be the best host, it is very unlikly that something like with the other hosts will happen.
At least I hope so...
One thing I don't think anyone's mentioned (a slap on the wrist for me if they have), the window titles are drawn slightly outside of the titlebars, until you actually click on the titlebar, at which point it moves into the correct position.
The window tiltle is only temporary. Just a simple printstring of the windows number as a debug information.
The current version (which is not available to the public yet) use another template for the gadgets (window title, scrollbars, etc) like this:

1th row is the horizontal scrollbar
2nd row is the vertical scrollbar
3th row is for buttons like minimze, help etc
4th row is the Title Bar and another button
5th row is the selector for menus and another button.

And thanks for you opinion and the info about the speed. It's good to hear that you like my work so far.

Posted on 2004-06-03 23:37:29

Buckermann

Quote:Originally posted by Omni

Also, I can see how you keep track of all the windows now --using a numerical list. Very smooth.

It was the easiest way i could think of to keep track of the windows. And I like it when it's as easy as possible. I guess some people would call me lazy.

And is there a place where I can get the source for your windows functions? I would really like to have a look at it.

Posted on 2004-06-03 23:42:42

Omni

Well, I can email them to you, but you'll have to have some Python libraries installed to actually run them.

My window demo, like I said, is simple. I plan on using it for a custom map editor, and I really have no need for functions like Window resizing and moving.

Though I may put in window moving for completeness...it wouldn't be too hard.

If you'd like me to email them to you, sure. Python's not too hard to understand (especially if you know it) :)

Posted on 2004-06-03 23:56:18

Buckermann

Quote:Originally posted by Omni

Well, I can email them to you, but you'll have to have some Python libraries installed to actually run them.
If the source isn't large than one MB you can mail it to the email adress in my profile.
And I'm sure I can get the libraries if they are avaiable somewhere. Maybe I even have them on my linux partition installed. Some time ago I installed quite a lot of them (and never used them since then...).

Posted on 2004-06-04 00:12:03

Omni

Well, all right then.

Posted on 2004-06-04 00:22:48


Displaying 21-28 of 28 total.
prev 1 2
 
Newest messages

Ben McGraw's lovingly crafted this website from scratch for years.
It's a lot prettier this go around because of Jon Wofford.
Verge-rpg.com is a member of the lunarnet irc network, and would like to take this opportunity to remind you that regardless how babies taste, it is wrong to eat them.