Window with round corners

Posted By: NeoJones

Window with round corners - 05/27/14 20:18

Hi! I need a window with round corners on a panel. How can I do that?
Posted By: xbox

Re: Window with round corners - 05/28/14 05:14

Since the manual only suggests the ability to have a square or rectangular window, I'd say create your panel that has the rounded "window" spot in an image editor of your choice, and fill it with black. Then select the window area along with the four round corner pieces to make a square/rectangular selection and save it separately. Then just create the panel and cut out the window in gamestudio, and use the separate panel as an overlay which would contain the four inside rounded corners and black filler which can be set to transparent.

Not too complicated but if it's not clear, let me know and I'll try and explain it better.
Posted By: NeoJones

Re: Window with round corners - 05/28/14 07:03

Sorry i dont understand. Than you have 2 Images. One with the black hole and transparent corners and One image as the original with corners... Ok, and then i have 2 panels... More i dont understand.. Can you explain Me a little bit more? laugh

Regards
Posted By: NeoJones

Re: Window with round corners - 05/28/14 11:53

Anyone maked non-rectangle "windows" ??

Here is an example what I mean:



Its not exact that what I need, but these panels have a mask, too.
Posted By: seneca

Re: Window with round corners - 05/28/14 12:20

I believe xbox has the right idea.

yes you will have two panels, but one will act like a mask, like in photoshop.
it will block out the corners to give a rounded look, but that is all it will do. your main image will be preserved and put what ever you want on that panel.


in fact I believe George did an AUM on it somewhere. I will have to search for it.
Posted By: NeoJones

Re: Window with round corners - 05/28/14 12:27

Thanks seneca. I've searched in the AUMs, too. I found nothing so far...
Posted By: seneca

Re: Window with round corners - 05/28/14 12:28

okay, let me see if I can make one and show you....it may take a while.
Posted By: NeoJones

Re: Window with round corners - 05/28/14 12:38

Thank you so much! wink
Posted By: seneca

Re: Window with round corners - 05/28/14 12:42

okay...I was wrong. it is not an AUM, it is in the online C-Lite tutorial http://tutorial.3dgamestudio.net/

look in Workshop 4: Bitmaps. that should show you how. if you still have any questions please post again.

hope this helps. this example may be better than the two panel approach....
Posted By: NeoJones

Re: Window with round corners - 05/28/14 13:05

Thanks, but.. there is no solution about my problem. I know, that a panel can have a layer or a bitmap with alpha channel ^^
Posted By: Ch40zzC0d3r

Re: Window with round corners - 05/28/14 13:51

You can draw it directly with engine or with bitmaps.
Bitmap:
You need to cut a mask in photoshop which has the size and form of your "window".
Now, render a filled rectangle in the size of your rectangle bitmap (with mask) and then draw the mask OVER your filled rectangle. You will only see through the mask.

Engine:
The same can be done in pure engine drawing with some sinus/cosinus functions if youve got some skills in maths grin
Posted By: NeoJones

Re: Window with round corners - 05/28/14 14:18

Sorry, I still dont understand how.
Can you explain me a little bit more or give me a little code example?
Posted By: Michael_Schwarz

Re: Window with round corners - 05/28/14 16:48

mach das fenster in photoshop/gimp mit den abgerundeten ecken und zeig das einfach an
Posted By: NeoJones

Re: Window with round corners - 05/28/14 17:31

Originally Posted By: Michael_Schwarz
mach das fenster in photoshop/gimp mit den abgerundeten ecken und zeig das einfach an
?? Ich möchte doch net einfach nur ein abgerundetes Bild anzeigen Oo
Ich habe ein Kreis (Maske 32bit tga) und eine normale Bitmap (24bit) in derselben Grösse, welche sich nun innerhalb der Maske auf und ab bewegen soll.

So ähnlich wie hier auf dem Bild:


Ist das so komplex zu realisieren??

Posted By: Ch40zzC0d3r

Re: Window with round corners - 05/28/14 17:33

@Michael_Schwarz
Er will keine bitmap sondern ein window mit dem Befehl "window" was zb ne Healthbar anzeigt und dieses window möchte er abrunden und kein primitives viereck XD

@Dragonfly
Benutze am besten erstmal die engine draw methode, meine erste Methode hat sich als schwieriger auszuführen gesatltet, als ich dachte.
Also einfach cos/sin Funktionen für die Krümmung benutzen.

EDIT: Du kannst auch das ganze 3D machen (mit Modellen) eine camera an die stelle platzieren, die flags so setzen:
Code:
flags = SHOW | NOSKY | NOWORLD | NOENT;


Und dann das ganze in eine bitmap auf deinem bildschirm rendern. Dann wäre der Rand auch unsichtbar tongue
Hört sich schwerer an als es ist, wenn du das nicht hinbekommst kann ich dir mit der camera helfen.
Ich denke es gibt ne leichtere Methode nur leider fällt mir grad nix besseres ein frown
Posted By: NeoJones

Re: Window with round corners - 05/28/14 17:45

Danke, ja ich hatte mal so ein Problem mit einer abgerundeten Minimap. Mit bmap_process habe ich dann eine View auf die 32bit maske auf ein Panel gerendert.
Ist in der Tat eine Alternative. Mich würds nur echt wundern, wenns keine einfachere Methode gibt. GS gibt seit sovielen Jahren und solche Art von Panels sind heutzutage immer noch so ein Problem? Ich meine, wer benutzt denn heutzutage gerne noch einfache, rechteckige Anzeigen? xD
Posted By: Ch40zzC0d3r

Re: Window with round corners - 05/28/14 20:25

KP, kannst auch viewentities usen^^
© 2024 lite-C Forums