![]() |
Fullscreen - Printable Version +- Mirage Engine (https://mirage-engine.uk/forums) +-- Forum: Mirage Source (Nostalgia) (https://mirage-engine.uk/forums/forumdisplay.php?fid=61) +--- Forum: Archive (2006-2011) (https://mirage-engine.uk/forums/forumdisplay.php?fid=18) +---- Forum: Resources (https://mirage-engine.uk/forums/forumdisplay.php?fid=49) +---- Thread: Fullscreen (/showthread.php?tid=271) |
Fullscreen - Tutorial Bot - 25-08-2006 Author: Robin Difficulty: Requires ability to understand. This tutorial will allow user's to be able to choose from several options, including windowed, to make the game more suitable for them. User configuration is really a good thing to add in. For example, in Naruto Realm Beta, user's can choose which effects to add to text, they can choose font face, font size, resolution and can also enter optional details about themselves, for other people to see and also which way they would like to play music. eg. FMod or Mirage Default. Now, because this is being made for a Vanilla MSE Build 1, and we are only adding in one option, I will add it into frmChars. I would suggest having an option menu for people when they open the client instead, though. Now, add these items into frmChars: Syn: Type | Name | Details Combo | cmbFulllscreen | Enabled = false. List = 640x480, 800x600, 1024x768, 1280x1024. Type = Dropdown List. Option | optFullscreen | Value = false Option | optWindow | Value = true Now we want it so that when people select Windowed, the combo box becomes disabled, and then enabled when Fullscreen is selected, so... Add this code into frmChars: Code: Private Sub optFullscreen_Click() Goto modDirectX, delete: Code: ' Indicate windows mode application and replace with this: Code: If frmChars.optFullscreen.Value = True Then What this does is finds which options they selected, and set the display mod accordingly. Then, if it is fullscreen, the cooperative level in frmMirage is set to fullscreen mode(?). If not, then we add a border into frmMirage, re-do the caption, then set the cooperative level to that of just normal(?). Either create a new module and put this in, or add to another module (I had it in modGeneral. Don't think that exists in Vanilla Mirage) Code: Public Sub ChangeBorderStyle(TheForm As Form, Style As Byte) I found that in these forums, posted by GSD. I think it may be in Tutorial Request, or general or something. Anyway, someone asked for some code to change the borderstyle, and I took it. Now add this sub somewhere. Again, I had it in modGeneral. Code: Public Sub Getwindowcolours() This is a sub which get's the desktop hwnd, get's the DC, then, finds the number of colours. We then release the DC and now we have the desktop's colour setting's saved. Add this into modGlobals: Code: ' Fullscreen For the above code. I had this code in modEnum, you can add anywhere. Code: Public Enum ColourDepth enumerate the colours. Add these into modConstants Code: 'for the change form border subroutine Just some code which came with the border changer. Add these into modDeclares: Code: Public Declare Function SetWindowPos Lib "user32" (ByVal hWnd&, ByVal hWndInsertAfter&, ByVal X&, ByVal Y&, ByVal CX&, ByVal CY&, ByVal wFlags&) As Long Again, came with the border change code. And finally, goto frmMirage and change borderstyle to: Code: 0 - None Obviously, GSD or whoever didn't know how to set the border style to 0, so we have to change frmMirage from 0 to something else. In this case, 2 - Sizable. You should now have working fullscreen support. It does look very rubbish with the default maps, but I am adding in scrolling maps into my client, which work in all resolutions. Players can choose which resolution they want. If you want, you can change it so people choose their own colour quality. I simply added some code which get's the desktop's colour quality and uses that, for compatability reasons. If you are really lazy, or not too confident programming, you can just as easily change it to a set resolution. This is probably not the best way to go about things, but it works fine on both Naruto Realm and my SPRPG, Wind's Whisper. Oh, by the way. This will look pretty bad with the default style of GUI (eg. Having the map in a box with pictures around it) and I would suggest having a small GUI blted on screen, or simply non at all. With Inventory, Spells, Shops and the such blted on screen to make your game look more professional. Have Fun_^ P.S. No other forms will be able to be loaded. If you add this in you must convert frmTrade, frmTraining and all other external forms to either picture boxes, or to Blted objects, like I did. Having them blted will allow for cool alphablending shizzle like in Naruto Realm Beta ![]() ~Kite - Tunes - 25-08-2006 How could i blit it and make it alphablend? Help Please. Thanks ^-^ - Robin - 25-08-2006 It takes a lot of coding, but what you want to do is get rid of all the picture boxes, list etc. and have all the game blted. Instead of having all the forms and stuff. Ugly :? I can't really just tell you what to do. You have to do it for yourself. But, instead of using BltFast, you can grab the DC's of the surface's and use BitBlt, which many people have created Alpha-Blending functions for. ![]() - DarkX - 25-08-2006 Real quick question, is this all Client side or does some of it branch into Server Side cuz theres only a mod general on server side in MSE. - Robin - 25-08-2006 It's all client side. If you read through it you would notice that I said you could put them anywhere, but I also said that I put them in modGeneral, which, as you said does not yet exist in MSE. Of course... you could just add one in. ~Kite - DarkX - 26-08-2006 I did but I also noticed that you were correct, that you have to change the style of the thingy from having multiple forms. Currently trying to figure out how to change it (but of course I'm clueless on it... freaking bliting) - Robin - 26-08-2006 As soon as you learn to blt, send packets and learn basic arithmetic... game creation is quite easy xD - DarkX - 26-08-2006 I'm learning the packets but the bliting is over my head for the time being. - Spodi - 26-08-2006 Quote:But, instead of using BltFast, you can grab the DC's of the surface's and use BitBlt, which many people have created Alpha-Blending functions for. Watch out, though - using this is really going to boost up the system requirements of your game. Alphablending through DirectDraw is quite slow, and even slower through BitBlt. - funkynut - 26-08-2006 Yep, if you want it simply, do it the way dave said, but be careful, it can get strange results with certain colours lol I tryed using it so I could have day/night (This was ages ago). Maybe i'm mistaken and it wasnt srcAnd Actually, I made an app awhile ago to show how each type looks when blted over different backgrounds. You can get some strange effects when combining them ![]() - Robin - 26-08-2006 Alphablending works fine if you add some options client side. also, using it sparingly (for Inventory, maybe a little background to where you are typing) then it works wonders. The options will be something like this: High (full alphablending... slow(ish) on older systems) Low (way dave said) None (just goes back to bltFast) This means people who can play HL2 with full setting's get some nice effects, and those people who struggle to run Runescape get some... well... they get to play the game. ~Kite - Remedy - 26-08-2006 Kite Wrote:As soon as you learn to blt, send packets and learn basic arithmetic... game creation is quite easy xD How'd you learn how to blit? - Krloz - 26-08-2006 @up Messing with it @kite:offtopic I need the updated version of Windwisper xd - Robin - 26-08-2006 Heheh ok. Come on MSN then. |