Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Multimedia (https://www.delphipraxis.net/16-multimedia/)
-   -   Delphi Create game-like Full-Screen (https://www.delphipraxis.net/54216-create-game-like-full-screen.html)

Cadere 29. Sep 2005 21:56


Create game-like Full-Screen
 
Hello,
Excuse my Englisch, My German is awfull, but I can read it.

As a self-educated programmer I'm trying to write sort of a game in Delphi.
For that game I want a fully black screen, where I will draw figures etc, etc.
<ESC> goes back to normal screen.
I don't get it done... lost in bitmaps, canvasses, images, windowstates etc...
Can somebody help me out?

T.I.A.
Cadere

Nikolas 29. Sep 2005 22:02

Re: Create game-like Full-Screen
 
Try this:

Set your Boderstyle on bsnone and increase your form to the size of the screen:

Delphi-Quellcode:
form1.Top :=0;
form1.Left:=0;

form1.Width:=screen.Width;
form1.Height:=screen.Height;

malo 29. Sep 2005 22:05

Re: Create game-like Full-Screen
 
Hi Cadere :hi:

Welcome to the Delphi-PRAXiS.

Try to set the settings in the Object-Inspector at your Form:
Delphi-Quellcode:
Form1.Formstyle := fsStayOnTop;
Form1.WindowState := wsMaximized;
BorderStyle := bsNone;
when you go to Fullscreen... that should make your window large enough for fullscreen. You need to set your components with anchors, so they will be always the right position and size. I hope so... :mrgreen:

edit: Damned... no red box :mrgreen:

2nd edit: Ehm... I think my code would not work as it has to. But there's a better version ;)

DP-Maintenance 29. Sep 2005 22:08

DP-Maintenance
 
Dieses Thema wurde von "sakura" von "Neuen Beitrag zur Code-Library hinzufügen" nach "Multimedia" verschoben.
moving off to the correct category :)

Nicolai1234 29. Sep 2005 22:32

Re: Create game-like Full-Screen
 
Zitat:

... that should make your window large enough for fullscreen.
but it isn't a fullscreen. It's just a great form. :mrgreen:

Ich kann das auf Englisch zu später Stunde nicht mehr erklären, aber vllt. kann das einer für mich übernehmen:
http://www.delphipraxis.net/internal...=363175#363175

Cadere 29. Sep 2005 23:46

Re: Create game-like Full-Screen
 
Nice contributions so far... thanx... but not yet.. : The One"

We are talking about a Form2, activated by the start-button in the game on Form1...

Your solution looks good Nicolai, but I dont have a unit or VCL that supports dmScreemsettings.
(I suppose with DelphiWorks I can create the same routine)

I guess the activating of form2 and restoring the screen afterwards will be interesting problems.

It is now too late to continue.. tomorrow is another day, my boss likes me more when I'm fit...
By the way... contributions in German are just as welcome as contributions in English.

:roteyes: goodnight

shmia 30. Sep 2005 09:54

Re: Create game-like Full-Screen
 
Delphi-Quellcode:
procedure MakeFullScreenForm(form : TForm);
begin
   Assert(Assigned(form));
   Form.BorderStyle := bsNone;
   Form.FormStyle := fsStayOnTop;
   Form.SetBounds(0, 0, Screen.Width, Screen.Height);
end;

Cadere 2. Okt 2005 20:32

Re: Create game-like Full-Screen
 
Okay shmia, this does the job.
After all so easy...

thank you...


Alle Zeitangaben in WEZ +1. Es ist jetzt 02:45 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz