GodWar Posted July 10, 2012 Author Share Posted July 10, 2012 How to add a resolution change support! At the moment i add 4 resolutions. After hours of calculation these 4 are the best. Its strange to add more resolution because off the calculation of the background :) But it is possible to add more. But my monitor don't allow more ^^. What i notice is that the EXE takes a little bit longer to load.**Screenshot:**[![](http://www.freemmorpgmaker.com/files/imagehost/pics/bf8096b85a741f4c3f4b98d50d253717.png)](http://www.freemmorpgmaker.com/files/imagehost/#bf8096b85a741f4c3f4b98d50d253717.png)**WAY 1****Client:**modContantsChange:```Private Direct3D_Window As D3DPRESENT_PARAMETERS 'Backbuffer and viewport description.```To:```Public Direct3D_Window As D3DPRESENT_PARAMETERS 'Backbuffer and viewport description.```* * *Change:```Public Const MAX_MAPX As Byte = 14Public Const MAX_MAPY As Byte = 11```To:```Public MAX_MAPX As BytePublic MAX_MAPY As Byte```* * *Change:```Public Const HalfX As Integer = ((MAX_MAPX + 1) / 2) * PIC_XPublic Const HalfY As Integer = ((MAX_MAPY + 1) / 2) * PIC_YPublic Const ScreenX As Integer = (MAX_MAPX + 1) * PIC_XPublic Const ScreenY As Integer = (MAX_MAPY + 1) * PIC_YPublic Const StartXValue As Integer = ((MAX_MAPX + 1) / 2)Public Const StartYValue As Integer = ((MAX_MAPY + 1) / 2)Public Const EndXValue As Integer = (MAX_MAPX + 1) + 1Public Const EndYValue As Integer = (MAX_MAPY + 1) + 1```To:```Public HalfX As IntegerPublic HalfY As IntegerPublic ScreenX As IntegerPublic ScreenY As IntegerPublic StartXValue As IntegerPublic StartYValue As IntegerPublic EndXValue As IntegerPublic EndYValue As Integer```* * *Change:```  Direct3D_Window.BackBufferWidth = 800 ' frmMain.picScreen.ScaleWidth 'Match the backbuffer width with the display width  Direct3D_Window.BackBufferHeight = 600 'frmMain.picScreen.ScaleHeight 'Match the backbuffer height with the display height```To:```  Direct3D_Window.BackBufferWidth = 960 ' frmMain.picScreen.ScaleWidth 'Match the backbuffer width with the display width  Direct3D_Window.BackBufferHeight = 768 'frmMain.picScreen.ScaleHeight 'Match the backbuffer height with the display height```And replace the frmMain.frm with yours in "\client\src\". (Before make secure copy of yours)And copy the your main images to "\client\data files\graphics\gui\main\"**WAY 2**Do the same like in Way 1 but **DON'T** replace the frmMain.Add a ComboBox wherever you wan't with the (Name) = "ComboResolution". I add it into the "picOptions" pictureBox.**Client:**frmMainBelow:```picCover.Width = picScreen.Width + 2```Add:```ComboResolution.AddItem "480x384"ComboResolution.AddItem "640x480"ComboResolution.AddItem "800x600"ComboResolution.AddItem "960x768"ComboResolution.ListIndex = 0```* * *At the end of the frmMain add:```' New Resolution BEGINPrivate Sub ComboResolution_Click()Dim resWidth, resHeight As LongDim res() As String  res() = Split(ComboResolution.List(ComboResolution.ListIndex), "x")  Direct3D_Window.BackBufferWidth = res(0)  Direct3D_Window.BackBufferHeight = res(1)  MAX_MAPX = res(0) / 32 - 1  MAX_MAPY = res(1) / 32 - 1  HalfX = ((MAX_MAPX + 1) / 2) * PIC_X  HalfY = ((MAX_MAPY + 1) / 2) * PIC_Y  ScreenX = (MAX_MAPX + 1) * PIC_X  ScreenY = (MAX_MAPY + 1) * PIC_Y  StartXValue = ((MAX_MAPX + 1) / 2)  StartYValue = ((MAX_MAPY + 1) / 2)  EndXValue = (MAX_MAPX + 1) + 1  EndYValue = (MAX_MAPY + 1) + 1  ' Change Background  frmMain.Picture = LoadPicture(App.Path & "\data files\graphics\gui\main\main" & ComboResolution.ListIndex & ".jpg")  picScreen.Width = res(0)  picScreen.Height = res(1)  ' Move GUI  imgHPBar.Left = 518 + (ComboResolution.ListIndex * 160)  imgMPBar.Left = 518 + (ComboResolution.ListIndex * 160)  imgEXPBar.Left = 518 + (ComboResolution.ListIndex * 160)  lblHP.Left = 632 + (ComboResolution.ListIndex * 160)  lblMP.Left = 632 + (ComboResolution.ListIndex * 160)  lblEXP.Left = 632 + (ComboResolution.ListIndex * 160)  lblGold.Left = 568 + (ComboResolution.ListIndex * 160)  lblPing.Left = 568 + (ComboResolution.ListIndex * 160)  imgButton(1).Left = 523 + (ComboResolution.ListIndex * 160)  imgButton(2).Left = 603 + (ComboResolution.ListIndex * 160)  imgButton(3).Left = 683 + (ComboResolution.ListIndex * 160)  imgButton(4).Left = 523 + (ComboResolution.ListIndex * 160)  imgButton(5).Left = 603 + (ComboResolution.ListIndex * 160)  imgButton(6).Left = 683 + (ComboResolution.ListIndex * 160)  picParty.Left = 541 + (ComboResolution.ListIndex * 160)  picOptions.Left = 541 + (ComboResolution.ListIndex * 160)  picSpells.Left = 541 + (ComboResolution.ListIndex * 160)  picInventory.Left = 541 + (ComboResolution.ListIndex * 160)  picCharacter.Left = 541 + (ComboResolution.ListIndex * 160)  picSSMap.Left = 800 + (ComboResolution.ListIndex * 160)  picCover.Left = 824 + (ComboResolution.ListIndex * 160)  picAdmin.Left = 544 + (ComboResolution.ListIndex * 160)  picTrade.Left = picScreen.Left + (picScreen.Width / 2 - picTrade.Width / 2)  picShop.Left = picScreen.Left + (picScreen.Width / 2 - picShop.Width / 2)  picBank.Left = picScreen.Left + (picScreen.Width / 2 - picBank.Width / 2)  If (ComboResolution.ListIndex = 0) Then    picHotbar.Top = 399    picEventChat.Top = 442    txtMyChat.Top = 565    txtChat.Top = 442    frmMain.Width = 11865    frmMain.Height = 9315  ElseIf (ComboResolution.ListIndex = 1) Then    picHotbar.Top = 399 + 96    picEventChat.Top = 442 + 96    txtMyChat.Top = 565 + 96    txtChat.Top = 442 + 96    frmMain.Width = 14250    frmMain.Height = 10770  ElseIf (ComboResolution.ListIndex = 2) Then    picHotbar.Top = 399 + 216    picEventChat.Top = 442 + 216    txtMyChat.Top = 565 + 216    txtChat.Top = 442 + 216    frmMain.Width = 16665    frmMain.Height = 12570  ElseIf (ComboResolution.ListIndex = 3) Then    picHotbar.Top = 399 + 384    picEventChat.Top = 442 + 384    txtMyChat.Top = 565 + 384    txtChat.Top = 442 + 384    frmMain.Width = 18975    frmMain.Height = 15080  End IfEnd Sub' New Resolution END```At me it works so far! I hope i moved all windows :)Hope you enjoy it :)And to jcsnider :)You can use it in your next release if you wan't :) Link to comment Share on other sites More sharing options...
DepTa Posted July 10, 2012 Share Posted July 10, 2012 this script work for eo_2_0_0 ? or only [EO - Event System 3.0] Resolution Changer ? Link to comment Share on other sites More sharing options...
GodWar Posted July 10, 2012 Author Share Posted July 10, 2012 @DepTa:> this script work for eo_2_0_0 ? or only [EO - Event System 3.0] Resolution Changer ?Than use WAY 2!!! I think it can work but i hope a moderator can answer this :) I personaly don't know the differents between these both! Link to comment Share on other sites More sharing options...
Joyce Posted July 10, 2012 Share Posted July 10, 2012 The theory works with EO 2.0, the code itself does not, specifically this part:```Direct3D_Window.BackBufferWidth = 960 ' frmMain.picScreen.ScaleWidth 'Match the backbuffer width with the display width  Direct3D_Window.BackBufferHeight = 768 'frmMain.picScreen.ScaleHeight 'Match the backbuffer height with the display height```Because EO 2.0 runs off of DirectDraw7, not Direct3D8. Link to comment Share on other sites More sharing options...
GodWar Posted July 10, 2012 Author Share Posted July 10, 2012 BUT there in 2.0 a different line? I think it can be the same… Or only a little different? I look wait :)*EDIT*Maybe here?```  With DDSD_BackBuffer    .lFlags = DDSD_CAPS Or DDSD_WIDTH Or DDSD_HEIGHT    .ddsCaps.lCaps = DDSD_Temp.ddsCaps.lCaps    .lWidth = (MAX_MAPX + 3) * PIC_X    .lHeight = (MAX_MAPY + 3) * PIC_Y  End With```lWidth and lHeight? Link to comment Share on other sites More sharing options...
or3o Posted July 10, 2012 Share Posted July 10, 2012 I almost asked how to make it display in 1080p but that would just be too much.. lol nice job tho! im gonna try it out now. Thanks for the tutorial! Soo far it works fine ill see if i can find any bugs k?isnt it possible to put all the ui elements on the picscreen now that we are working with directx 8?Also damn dude! 14 posts and your already better at this than me. Link to comment Share on other sites More sharing options...
Joyce Posted July 10, 2012 Share Posted July 10, 2012 Actually with the theory behind this it should be easy to make it adjust to ANY screensize, just grab the user's native resolution with an API, adjust the backbuffer to it and go from there. Would need to put all the UI elements on the picscreen for that to work properly though. :] Link to comment Share on other sites More sharing options...
Guest Posted July 10, 2012 Share Posted July 10, 2012 Nice job bro, *sigh* if only i had waited for this, i changed my resolution manually and edited gui to it QQ.good tutorial :) Link to comment Share on other sites More sharing options...
or3o Posted July 10, 2012 Share Posted July 10, 2012 hey set your resolution in the game to the low one then walk all the way to the left edge of the map, then set the resolution to the highest one, does your guy go off screen to>? Link to comment Share on other sites More sharing options...
GodWar Posted July 10, 2012 Author Share Posted July 10, 2012 Maybe when the map ich to small… or? that a little problem with the engine :) I watch this and see what i can do :) Link to comment Share on other sites More sharing options...
Joyce Posted July 10, 2012 Share Posted July 10, 2012 No, it's because your backbuffer is set to ALWAYS render at full size, so the camera doesn't work properly on scrolling maps. You'll need to adjust the resolution of what's rendered and the camera to the actual current size, not the largest available. Link to comment Share on other sites More sharing options...
GodWar Posted July 10, 2012 Author Share Posted July 10, 2012 OK i add a fix!TO ALL:For the WAY 1 user: Download the new frmMain and make the first change i add to Post 1!For the WAY 2 user: Do the first change io add in Post 1 and replace the whole "Private Sub ComboResolution_Click()"The only thing i doesn't know is what we do when the map is 14x11 (the smallest) and use the highest resolution. At the moment he renders at the bottom right! Link to comment Share on other sites More sharing options...
clark Posted July 13, 2012 Share Posted July 13, 2012 in Eclipse Nightly when i search : Private Direct3D_Window As D3DPRESENT_PARAMETERS 'Backbuffer and viewport description.it didn't found in Modconstants :/ …and when i research in the whole sources i found 2Please help me tell me exactly the code and where i have to place it into eclipse nightly Link to comment Share on other sites More sharing options...
GodWar Posted July 13, 2012 Author Share Posted July 13, 2012 Search for "Direct3D_Window" there are only one declaration ;) Maybe you have another comment behind or something… Link to comment Share on other sites More sharing options...
clark Posted July 13, 2012 Share Posted July 13, 2012 ^^ Thank you ! watch i did :Change:```Private Direct3D_Window As D3DPRESENT_PARAMETERS 'Backbuffer and viewport description.```To:```Public Direct3D_Window As D3DPRESENT_PARAMETERS 'Backbuffer and viewport description.```Change:```Public Const MAX_MAPX As Byte = 14Public Const MAX_MAPY As Byte = 11```To:```Public MAX_MAPX As BytePublic MAX_MAPY As Byte```Change:```Public Const HalfX As Integer = ((MAX_MAPX + 1) / 2) * PIC_XPublic Const HalfY As Integer = ((MAX_MAPY + 1) / 2) * PIC_YPublic Const ScreenX As Integer = (MAX_MAPX + 1) * PIC_XPublic Const ScreenY As Integer = (MAX_MAPY + 1) * PIC_YPublic Const StartXValue As Integer = ((MAX_MAPX + 1) / 2)Public Const StartYValue As Integer = ((MAX_MAPY + 1) / 2)Public Const EndXValue As Integer = (MAX_MAPX + 1) + 1Public Const EndYValue As Integer = (MAX_MAPY + 1) + 1```To:```Public HalfX As IntegerPublic HalfY As IntegerPublic ScreenX As IntegerPublic ScreenY As IntegerPublic StartXValue As IntegerPublic StartYValue As IntegerPublic EndXValue As IntegerPublic EndYValue As Integer```Change:  ```Direct3D_Window.BackBufferWidth = 800 ' frmMain.picScreen.ScaleWidth 'Match the backbuffer width with the display width  Direct3D_Window.BackBufferHeight = 600 'frmMain.picScreen.ScaleHeight 'Match the backbuffer height with the display height```To:  ```Direct3D_Window.BackBufferWidth = 960 ' frmMain.picScreen.ScaleWidth 'Match the backbuffer width with the display width  Direct3D_Window.BackBufferHeight = 768 'frmMain.picScreen.ScaleHeight 'Match the backbuffer height with the display height```and after this i didn't replaced the frmain , i just did everything in the way 2and when i compile it highlight : "Combo" :/ what wrong i did? Link to comment Share on other sites More sharing options...
GodWar Posted July 13, 2012 Author Share Posted July 13, 2012 Did you do all in Way 2? Also add the Private Sub ComboResolution_Click() Is the Combobox filled with the 4 resolutions? Does he anything when you change? Link to comment Share on other sites More sharing options...
clark Posted July 13, 2012 Share Posted July 13, 2012 Ohhh my bad i didn't noticed :/It would be nice to put it in quote haha !Thank you GodWar i'm going to try itEDIT : Working P-e-r-f-e-c-t-l-y , thanks GodWar to remind me this ^^But there is another problem when i change the resolution there is the map , but also there is blank on the sides when i try to map this i can't only i need to resize the map , to map it is it normal? Link to comment Share on other sites More sharing options...
GodWar Posted July 13, 2012 Author Share Posted July 13, 2012 Yes this is because the map is smaller than the resolution. If you use higher resolutions it is good to maker all maps minimum the maximum resolution :) Link to comment Share on other sites More sharing options...
clark Posted July 15, 2012 Share Posted July 15, 2012 Oh ok :P Thanks! Link to comment Share on other sites More sharing options...
or3o Posted August 5, 2012 Share Posted August 5, 2012 hey does anyone know how to get the changes to save after logout? so after you ste your resolution its always like that? Link to comment Share on other sites More sharing options...
Vaeriel Posted August 7, 2012 Share Posted August 7, 2012 I don't know why, but **in 960x768 when the x map size = 30 , there is a scrolling bug**.If you **set x = 29 or x = 31 there is no bug**.1 map size = 32px30 x 32 = 960px, but it seems the game tries to scroll..I guess you can find the **same scrolling bug with y map size = 24**(24 x 32 = 768) Link to comment Share on other sites More sharing options...
clark Posted October 8, 2012 Share Posted October 8, 2012 Sorry to up this topic but ,How do we know wich height width need to be the frmMain for 1024x768 and other resolutions? Link to comment Share on other sites More sharing options...
cjsrch Posted March 25, 2013 Share Posted March 25, 2013 any one have any pre made templates for the GUI in the different resolutions ( standard GUI) im not very good with graphics lol Link to comment Share on other sites More sharing options...
abhi2011 Posted March 25, 2013 Share Posted March 25, 2013 Even if they did I don't think they would hand it out to you. It would be better that you make your own. Link to comment Share on other sites More sharing options...
cjsrch Posted March 25, 2013 Share Posted March 25, 2013 Wasnt looking for anything custom just for default moved out to properdistances..I did it it just took some time and still does not match up 100 percent.Also if any one has added anything from default (quest or anything)be sure to findimgButton(6).Left = 683 + (ComboResolution.ListIndex * 160)picParty.Left = 541 + (ComboResolution.ListIndex * 160)and addYOURWINDOWNAME.Left = YOUR NUMBER + (ComboResolution.ListIndex * 160)or button Notice the number that is the ZERO offset (default gui) Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now