Chman
Sr. Member   Posts: 344
Nothing more that... Java games are cool !
|
 |
«
on:
2003-03-16 11:24:13 » |
|
I wonder if there was a way to create an irrgular window in Java... by "irregular" I mean that it can be, for example, a triangle window, or a circular window, or even a window with transparent hole in it!
Does anyone knows how to do that in Java ? or is there any lib (native or not) available on the web to do that ?
Thanks Chman
|
|
|
|
|
JasonB
Full Member   Posts: 196
|
 |
«
Reply #1 on:
2003-03-16 11:46:19 » |
|
I recall l2fprod having a native (windows) DLL for doing irregular windows. haven't checked recently, but it might still be available ( www.l2fprod.com)
|
|
|
|
|
cfmdobbie
JGO Wizard     Posts: 1257
Who, me?
|
 |
«
Reply #2 on:
2003-03-17 02:34:18 » |
|
Not something I've tried, but I believe it should work:
If you use a "Window" not a "Frame" you do away with all the titlebars, window frame etc. Then you can use a pixel-grabber to snapshot the screen contents behind your window, and paint them over the top to make your window effectively transparent. Then you're free to draw whatever shape windows you want!
PROS: Works pretty much everywhere without need for external libraries.
CONS: A lot more work, and you have to draw all the window decorations you want manually.
|
Hellomynameis Charlie Dobbie.
|
|
|
Games published by our own members! Go get 'em!
|
|
Chman
Sr. Member   Posts: 344
Nothing more that... Java games are cool !
|
 |
«
Reply #3 on:
2003-03-17 07:07:55 » |
|
Thx for your replies... I think cfmdobbie's solution is a good one (no need for external libs) but is not the easier to do... and not the faster !
|
|
|
|
|
Herkules
JGO Kernel      Posts: 1522 Medals: 1
Friendly fire isn't friendly!
|
 |
«
Reply #4 on:
2003-03-17 07:16:38 » |
|
cfmdobbie's solution does not cover event handling! I don't know how to ignore mouseclicks to the non-opaque parts of the window or to delegate them to the desktop/parent.
|
|
|
|
Chman
Sr. Member   Posts: 344
Nothing more that... Java games are cool !
|
 |
«
Reply #5 on:
2003-03-17 07:25:07 » |
|
ah yeah it's true, i haven't thought about that... o l2fprod would be a great solution but it's windows specific so...
|
|
|
|
|
cfmdobbie
JGO Wizard     Posts: 1257
Who, me?
|
 |
«
Reply #6 on:
2003-03-17 08:02:21 » |
|
Good point - I hadn't considered event handling.  Hrm, with the requirement to properly handle window events as well, I'm afraid you're high and dry. There's no way I know to do that in a platform-independant way. You will probably have to drop back to JNI, get a handle to the window and manipulate it directly with native windowing commands. Ouch.
|
Hellomynameis Charlie Dobbie.
|
|
|
Chman
Sr. Member   Posts: 344
Nothing more that... Java games are cool !
|
 |
«
Reply #7 on:
2003-03-17 09:27:13 » |
|
Ouch !  I will finally keep my classical Java JFrame...
|
|
|
|
|
pepe
Sr. Member   Posts: 402
Nothing unreal exists
|
 |
«
Reply #8 on:
2003-03-17 21:49:46 » |
|
there was a thread on the old board about that. there was even some code using Robot's screencapture. The thread ended with "it's a 1.5 feature", as far as i recall.. 
|
|
|
|
|
|
Games published by our own members! Go get 'em!
|
|
Chman
Sr. Member   Posts: 344
Nothing more that... Java games are cool !
|
 |
«
Reply #10 on:
2003-03-19 11:09:12 » |
|
Ca fait plaisir de voir des francais sur cette board ! non en fait ca n'a aucun rapport avec la team cHMan... tu faisait référence à Banja, un jeu en flash de la team en question... mon pseudo vient de nul part... et j'ai l'habitude de l'écrire Ch*man pour éviter la confusion avec cHMan...
|
|
|
|
|
mill
Full Member   Posts: 196
popcorn freak
|
 |
«
Reply #11 on:
2003-03-20 13:09:48 » |
|
argh! why do people post in languages other than english? english the the most common language here as this is a forum and the whole purpose is to let people communicate. i'm sure everyone would understand me typing swedish!
bad english is also ok! (i know you french people don't like it very much)
|
|
|
|
cfmdobbie
JGO Wizard     Posts: 1257
Who, me?
|
 |
«
Reply #12 on:
2003-03-20 15:15:16 » |
|
|
Hellomynameis Charlie Dobbie.
|
|
|
mill
Full Member   Posts: 196
popcorn freak
|
 |
«
Reply #13 on:
2003-03-20 15:38:33 » |
|
it's not so bad on this forum, not yet anyway. at cgtalk for instance it's a common thing and it's pretty pointless. anyway, i have no idea what chocolate moose you're talking about lol  sorry for drifting away from topic..
|
|
|
|
pepe
Sr. Member   Posts: 402
Nothing unreal exists
|
 |
«
Reply #14 on:
2003-03-20 21:04:37 » |
|
Hem, sorry, guys. The little french sentence was to ask about the origin of ch*man's nick. There are times you feel quite alone as a French citizen, actually more than ever.  Some 'native' words help sometimes. Well... Enough drama, will not do that again, i swear. (moreover, i wasn't sure to explain myself correctly in english.. that was a lazy solution as well. ) Back on topic. After re reading the bug report i posted here, and the answer from sun, i'm not sure that the RFE is to be implemented. Isn't there an AWT team member reading us?
|
|
|
|
mill
Full Member   Posts: 196
popcorn freak
|
 |
«
Reply #15 on:
2003-03-21 00:45:42 » |
|
you're not alone, we are all with you! 
|
|
|
|
javatypo
Full Member   Posts: 143
|
 |
«
Reply #16 on:
2003-04-06 15:24:51 » |
|
having a transparent window could post some pretty weird things..
like u could make your program launch an entire window, that is totally transparent, and have no way out..
hehe.. that'd be pretty funny..
why do u want a transparent window anyway??
|
|
|
|
|
cfmdobbie
JGO Wizard     Posts: 1257
Who, me?
|
 |
«
Reply #17 on:
2003-04-06 17:42:06 » |
|
It's less having transparent windows than shaped windows. Rounded corners to your windows, a round (analogue) clock, see-through areas etc.
|
Hellomynameis Charlie Dobbie.
|
|
|
javatypo
Full Member   Posts: 143
|
 |
«
Reply #18 on:
2003-04-07 14:06:50 » |
|
thatd be annoying to have se thru parts of a window..
wouldnt it?
|
|
|
|
|
cfmdobbie
JGO Wizard     Posts: 1257
Who, me?
|
 |
«
Reply #19 on:
2003-04-07 15:27:20 » |
|
Um. Not if that's what you wanted to have? 
|
Hellomynameis Charlie Dobbie.
|
|
|
swpalmer
JGO Kernel      Posts: 3438 Medals: 4
Where's the Kaboom?
|
 |
«
Reply #20 on:
2003-04-07 19:59:30 » |
|
Rounded corners, or completely wacky UI shapes like the skinned views of latest MS Media players.. That's the sort of stuff that we need.
It would also be a way to drag arbitrary objects over the desktop.. instead of just getting some lame cursor that doesn't really show what is happening.
I think it is time to add support for windows with an alpha channel (even if it is restricted to 1-bit on some platforms) to Java. All popular windowing systems support this feature now, so it makes sense.
|
|
|
|
Abuse
JGO Kernel      Posts: 1866 Medals: 5
falling into the abyss of reality
|
 |
«
Reply #21 on:
2003-04-07 20:09:16 » |
|
sounds like fun, though I dread to think how a semi transparent full screen frame would behave 
|
|
|
|
|
|