Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

[EO] Full-Screen frmMainGame


The New World
 Share

Recommended Posts

[EO] Full-Screen Tutorial

Pre-Requisites: http://www.touchofdeathforums.com/smf/index.php?topic=61858.0

To get the most out of this short and simple tutorial you must understand how to successfully change the size of the picScreen and MAX_MAP to fit any size you please.

This still allows the editors to over lap the game.

This will all be Client-Side

For complete full-screen, disable your form's controlbox and set the borders to 0 - None.

In modDirectDraw7 find…

```
Call DD.SetCooperativeLevel(frmMainGame.hWnd, DDSCL_NORMAL)
```
![](http://www.freemmorpgmaker.com/files/imagehost/pics/074c1c9a7aff55ac026ba6f901c7a729.png)

As commented above it within the source, it says that
"' dictates how we access the screen and how other programs
' running at the same time will be allowed to access the screen as well."

We want to change that one line of code to this..

```
Call DD.SetCooperativeLevel(frmMainGame.hWnd, DDSCL_FULLSCREEN Or DDSCL_ALLOWMODEX Or DDSCL_EXCLUSIVE)
```
And directly below it we want to add..

```
Call DD.SetDisplayMode(1024, 768, 32, 0, DDSDM_DEFAULT)
```
![](http://www.freemmorpgmaker.com/files/imagehost/pics/9a15976507fc5bd6e12a4dee872b46c5.PNG)

Explanation..

```
DDSCL_FULLSCREEN
```This is a DirectDraw command to set the given form in full-screen. Which is this case was declared to be frmMainGame.

```
DDSCL_EXCLUSIVE
```This means that our application has complete control over DirectDraw, so other windows stuff is kept out.

```
DD.SetDisplayMode(1024, 768, 32, 0
```This DirectDraw command sets the display mode to the resolution of 1024, 768 and the 32 is the set colour quality. These can be changed to fit your needs, I simply used my own desktop resolution.

If you want something that comes before the MainGame form to be fullscreen, you must empty the string before each new set. Like this.

```
Set DD = DX7.DirectDrawCreate(vbNullString)
Call DD.SetCooperativeLevel([color]FORMNAME[/color].hWnd, DDSCL_FULLSCREEN Or DDSCL_ALLOWMODEX Or DDSCL_EXCLUSIVE)
Call DD.SetDisplayMode(1024, 768, 32, 0, DDSDM_DEFAULT)

'Second form loaded to be full-screen
Set DD = DX7.DirectDrawCreate(vbNullString)
Call DD.SetCooperativeLevel([color]FORMNAME[/color].hWnd, DDSCL_FULLSCREEN Or DDSCL_ALLOWMODEX Or DDSCL_EXCLUSIVE)
Call DD.SetDisplayMode(1024, 768, 32, 0, DDSDM_DEFAULT)

Note: I have yet to get it to set it to the user's current resolution, but for now, heres a starting point for a fixed res. :P

To come: I suppose I'll just have to teach you how to make it optional to play in a windowed or full-screen mode, as well as set it to the user's resolution and not just what you set.

```
Link to comment
Share on other sites

That only happens when your resolution isn't correctly set to fit your own needs, and when you don't include```
Call DD.SetCooperativeLevel(frmMainGame.hWnd, DDSCL_FULLSCREEN Or DDSCL_ALLOWMODEX Or DDSCL_EXCLUSIVE)
```This was only a base, I might just go ahead and add how to make it optional to play in Full-Screen or Windowed mode as well as setting it to the user's resolution.
Link to comment
Share on other sites

Well, to get the screen's resolution you would have first get the resolution.
```
Dim ScreenWidth as String
Dim ScreenHeight as String

ScreenWidth = (Screen.Width / Screen.TwipsPerPixelX)
ScreenHeight = (Screen.Height / Screen.TwipsPerPixelY)

```We set to variables, ScreenWidth and ScreenHeight.
We set them to your Screen's Width, and your screen height. Though, this will return some ridiculously high number that is not right. Therefor, we have to divide it by the TwipsPerPixel X/Y it makes.

Then:
```
Call DD.SetDisplayMode(ScreenWidth, ScreenHeight, 32, 0, DDSDM_DEFAULT)
```
Link to comment
Share on other sites

@Kinjiru:

> @Yukiyo:
>
> > @Kinjiru:
> >
> > > This didnt work for me, this happened
> > >
> > > >! ![](http://www.freemmorpgmaker.com/files/imagehost/pics/0d296a3e85d14a6e4ba9d00a3fd664b4.png)
> >
> > Did you use your own resolution?
>
> yes, 1440x900

bleh, I don't think I ever posted because everyone ignored this but, All this does is effect the hWnd of the form. If you want true full screen, just set your border to 0 - None and change your MAX_MAPX and MAX_MAPY, as well as your picScreen to fit. This tutorial wasn't truly based on EO but more as a basis for working more with the form functionality of DD7.
Link to comment
Share on other sites

@Yukiyo:

> @Kinjiru:
>
> > @Yukiyo:
> >
> > > @Kinjiru:
> > >
> > > > This didnt work for me, this happened
> > > >
> > > > >! ![](http://www.freemmorpgmaker.com/files/imagehost/pics/0d296a3e85d14a6e4ba9d00a3fd664b4.png)
> > >
> > > Did you use your own resolution?
> >
> > yes, 1440x900
>
> bleh, I don't think I ever posted because everyone ignored this but, All this does is effect the hWnd of the form. If you want true full screen, just set your border to 0 - None and change your MAX_MAPX and MAX_MAPY, as well as your picScreen to fit. This tutorial wasn't truly based on EO but more as a basis for working more with the form functionality of DD7.

Ah,  see what you mean
Link to comment
Share on other sites

Problem with this is what if the Owner has a giant monitor and a really big resolution, but their players have small monitors and smaller resolutions, since it is all setup for the owners comp the screen will be messed up for everyone else..

Same thing goes for making no border and just making it all spread out across the fullscreen program because if the owner has more room then things might be off other players screens…
Link to comment
Share on other sites

  • 3 weeks later...
  • 1 month later...
  • 1 year later...
  • 4 weeks later...
  • 3 weeks later...
**I have only this**:
![](http://img249.imageshack.us/img249/7107/20111229122407.png)

And how I change the code to this:

**Call DD.SetCooperativeLevel(frmMainGame.hWnd, DDSCL_FULLSCREEN Or DDSCL_ALLOWMODEX Or DDSCL_EXCLUSIVE)
Call DD.SetDisplayMode(1024, 768, 32, 0, DDSDM_DEFAULT)**

**I have this** when I run the game:

![](http://img225.imageshack.us/img225/998/20111229122506.png)

why ? and what I should do ?  :sad: please help  :sad:  :embarrassed:
Link to comment
Share on other sites

@wito35:

> **I have only this**:
> ![](http://img249.imageshack.us/img249/7107/20111229122407.png)
>
> And how I change the code to this:
>
> **Call DD.SetCooperativeLevel(frmMainGame.hWnd, DDSCL_FULLSCREEN Or DDSCL_ALLOWMODEX Or DDSCL_EXCLUSIVE)
> Call DD.SetDisplayMode(1024, 768, 32, 0, DDSDM_DEFAULT)**
>
> **I have this** when I run the game:
>
> ![](http://img225.imageshack.us/img225/998/20111229122506.png)
>
> why ? and what I should do ?  :sad: please help  :sad:  :embarrassed:

Here is what you need to do to make it work with EO2.0:

change
Call DD.SetCooperativeLevel(frmMainGame.hWnd, DDSCL_FULLSCREEN Or DDSCL_ALLOWMODEX Or DDSCL_EXCLUSIVE)

to DD.SetCooperativeLevel frmMain.hWnd, DDSCL_FULLSCREEN Or DDSCL_ALLOWMODEX Or DDSCL_EXCLUSIVE

change Call DD.SetDisplayMode(1024, 768, 32, 0, DDSDM_DEFAULT)

to DD.SetDisplayMode 1024, 768, 32, 0, DDSDM_DEFAULT

THIS IS HIGHLY UNRECOMMENDED
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...