santa-clause Posted July 26, 2013 Author Share Posted July 26, 2013 Hello everyone,Some info about tutorial:Difficulty: normalSupported engines:-CS:DE-Mirage source-Eclipse advanced-All other engines based on CS:DE-It can work with other dx8 engines like EO3.0 and all others but the modules and some names of classes are different that's all but the logic behind it is the same.Credits: Santa-ClauseSpecial Thanks to: Thomas And Robin (for making these awesome engines)**Chapter 1: Rendering a guiwindow**So here i will explain how to render a guiwindowThe first thing you do is go to modrendering and scroll all the way down.Then make a sub (in this example we will use DrawTest)```Public Sub DrawTest()Dim X As Long, Y As Long, Width As Long, Height As Long X = GUIWindow(GUI_TEST).X Y = GUIWindow(GUI_TEST).Y Width = GUIWindow(GUI_TEST).Width Height = GUIWindow(GUI_TEST).Height Directx8.RenderTexture Tex_GUI(2), X, Y, 0, 0, Width, Height, Width, Height RenderText Font_Default, "Test Window", (GUIWindow(GUI_TEST).Width / 2) - EngineGetTextWidth(Font_Default, "Test Window"), Y + 5, WhiteEnd Sub```[attachment=916:delala.png](GUIWindow(GUI_TEST).Width / 2) - EngineGetTextWidth(Font_Default, "Test Window") This line of code does the following:Guiwindow(GUI_TEST).width gets the width of the window ofcourse and he devides that by 2 so half the window.Then he does Enginetextgetwidth whit fontdefault and for test("Test window) and he also devides that by 2 so this text will be on top of the window and centeredAnd Directx8.rendertexture TEX_GUI(2),x,y,0,0,width,height,width,height simply renders the image whit the name 2.png from the gui folder.Warning: make sure you all numbers in gui folder are consecutive.Now in initialisegui in modgeneral:```' 21 - Test With GUIWindow(GUI_TEST) .X = 300 .Y = 100 .Width = 257 .Height = 152 .visible = False End With```So this just defines the posision and the height and width of the window(picture).At the end of Public Enum GUITypeadd GUI_TESTWarning: put it above GUI_COUNTIn Public Sub DrawGUI() Add:```If GUIWindow(GUI_TEST).visible Then DrawTest```**Chapter 2: Clicking**Here i will talk about how to make windows clickableOk so what you wanna do first is test if the window you've rendered is actually rendering correctly then go on and follow thisNow in Public Sub HandleMouseUp(ByVal Button As Long)add this at the end before end select:```Case GUI_TEST Test_mouseup```So this just sends the client to another sub when it sees that GUI_TEST is clicked (mouseup)(no need to explain it i think)```Public Sub Test_mouseup()Dim X As Long, Y As Long X = GUIWindow(GUI_TEST).X Y = GUIWindow(GUI_TEST).Y If GlobalX > X+35 And GlobalY > Y+54 Then 'Point 1 If GlobalX < X+3 And GlobalY < Y+23 Then 'Point 2 Call Something End If End IfEnd Sub```So this actually does what it needs to do if you click itNormally you just put all those coordinates in one if but i devided into 2points and i'll explain in the picture under this text:[attachment=917:tutorial.png]I can add extra Chapters if you wantI hope you all enjoyed this tutorial and i hope it's usefull it's pretty basic but i didn't wanna make it too hard for a first tutorial on this forum about rendering in dx8.Please like tutorial if it helped you or if you just like it :) You can also use Paint.net for coordinates i also use it its very handy you can see pixel coordinates at right bottom. :)Regards Santa, Link to comment Share on other sites More sharing options...
JohnPony Posted July 26, 2013 Share Posted July 26, 2013 This isn't very hard… Link to comment Share on other sites More sharing options...
santa-clause Posted July 26, 2013 Author Share Posted July 26, 2013 > This isn't very hard…Some ppl think this is hard Link to comment Share on other sites More sharing options...
Abyssrayel Posted July 26, 2013 Share Posted July 26, 2013 This is a useful tutorial for those who don't know a single thing about how a GUI renders. Don't say it's easy, you had to learn how to walk just like the rest of us. Link to comment Share on other sites More sharing options...
santa-clause Posted July 26, 2013 Author Share Posted July 26, 2013 > This is a useful tutorial for those who don't know a single thing about how a GUI renders. Don't say it's easy, you had to learn how to walk just like the rest of us.It's called a basic tutorial for something :pI'm also aiming for beginners not for ppl like general awesome but whatever.Tnx for reply ;) Link to comment Share on other sites More sharing options...
JohnPony Posted July 26, 2013 Share Posted July 26, 2013 > It's called a basic tutorial for something :P> > I'm also aiming for beginners not for ppl like general awesome but whatever.> > Tnx for reply ;)You still did a nice job. Thank you for the contribution. Link to comment Share on other sites More sharing options...
santa-clause Posted July 26, 2013 Author Share Posted July 26, 2013 > You still did a nice job. Thank you for the contribution.tnx :D Link to comment Share on other sites More sharing options...
JohnPony Posted March 23, 2014 Share Posted March 23, 2014 Just realized that you're using the standard first quadrant graph to represent a 2D computer view.I personally think this is a extremely bad way to represent things.It should be more like:![](http://i.imgur.com/GqhgbCZ.png)Whilst both the X and Y values start at 0 and increase to infinity, as happens in the first quadrant, the quadrant that better represents them in this case is the 4th one with the Y values inverted. Link to comment Share on other sites More sharing options...
santa-clause Posted March 25, 2014 Author Share Posted March 25, 2014 > Just realized that you're using the standard first quadrant graph to represent a 2D computer view.> > > > I personally think this is a extremely bad way to represent things.> > > > It should be more like:> > ![](http://i.imgur.com/GqhgbCZ.png)> > Whilst both the X and Y values start at 0 and increase to infinity, as happens in the first quadrant, the quadrant that better represents them in this case is the 4th one with the Y values inverted.True, i'll maybe change it some day. Link to comment Share on other sites More sharing options...
hisherwin Posted March 26, 2014 Share Posted March 26, 2014 i'm disappointed, i thought you'll explain how to setup DX8 Link to comment Share on other sites More sharing options...
abhi2011 Posted March 26, 2014 Share Posted March 26, 2014 For that go to [http://directx4vb.vbgamer.com/](http://directx4vb.vbgamer.com/) Link to comment Share on other sites More sharing options...
santa-clause Posted March 26, 2014 Author Share Posted March 26, 2014 > i'm disappointed, i thought you'll explain how to setup DX8Such tutorial would take me a very long time and wouldn't be very easy and then it would no longer be "basic" Link to comment Share on other sites More sharing options...
willzter Posted March 26, 2014 Share Posted March 26, 2014 I might sound like a total noob right now (which I kind of am) but for some reason I can't seem to find modRendering, I'm using EO 3.0 - Electrified Events which (from what I know) was the first Eclipse Engine using DirectX 8\. If the rendering module simply is named something else in EO 3.0 and somone knows it, please answer me. I have found a class module called cGDIpRenderer, however, since I don't want to mess something up I would rather take the safe before the unsafe and ask here on the forums first. cGDIpRenderer is located in the client.vbp if anyone wants to know. Link to comment Share on other sites More sharing options...
Growlith1223 Posted March 26, 2014 Share Posted March 26, 2014 it is not the first engine to use DX8\. i am pretty sure CSDE came before EO 3 lolanywho, it's not modRendering in 3.0, it should be modGraphics Link to comment Share on other sites More sharing options...
willzter Posted March 26, 2014 Share Posted March 26, 2014 Ok, thanks. I've actually never heard of CSDE, but then I'm still kind of a noob here (only been here for 1.5 years and I have been offline alot) so it was probably out long before I even heard about eclipse. Link to comment Share on other sites More sharing options...
Growlith1223 Posted March 26, 2014 Share Posted March 26, 2014 CSDE is more a modification to EO that was released years ago. not sure if you can get it anywhere anymore but yea. Link to comment Share on other sites More sharing options...
santa-clause Posted March 27, 2014 Author Share Posted March 27, 2014 > I might sound like a total noob right now (which I kind of am) but for some reason I can't seem to find modRendering, I'm using EO 3.0 - Electrified Events which (from what I know) was the first Eclipse Engine using DirectX 8\. If the rendering module simply is named something else in EO 3.0 and somone knows it, please answer me. I have found a class module called cGDIpRenderer, however, since I don't want to mess something up I would rather take the safe before the unsafe and ask here on the forums first. cGDIpRenderer is located in the client.vbp if anyone wants to know.Actually this engine was made for CS:DE, Mirage Source, Eclipse Advance and all other things that are based on CS:DE.But ir should also work on eo3.0 with some customizations Link to comment Share on other sites More sharing options...
santa-clause Posted March 27, 2014 Author Share Posted March 27, 2014 > i'm disappointed, i thought you'll explain how to setup DX8I'll maybe make a tutorial like that onceBut now i'm actually kinda busy with making my own engine and game. Link to comment Share on other sites More sharing options...
abhi2011 Posted March 27, 2014 Share Posted March 27, 2014 > CSDE is more a modification to EO that was released years ago. not sure if you can get it anywhere anymore but yea.CS:DE isn't a modification to EO just released to the public.CS:DE or Crystal Shire:Developers Editor was and engine developed by Robin whom AFAIK created the Eclipse Origins engine. He left after EO 2.0 and created his own game: [CrystalShire](http://Crystalshire.com). He made a major change to his game by adding in a better graphics management and revamped the login system. He sold the "old" game and after that he just released it. You can get it by downloading Robin's Amazing bundle found in the resources section. Link to comment Share on other sites More sharing options...
Growlith1223 Posted March 27, 2014 Share Posted March 27, 2014 I know all of this. just didn't think it was necessary to say it Link to comment Share on other sites More sharing options...
My Brave Shine Posted May 20, 2014 Share Posted May 20, 2014 TEX_GUI(#),x,y,0,0# = Num. of Pic in the past GUI?ex:.. i want render the pic 30.png.. in GUI Folder.. i change the # for 30? Link to comment Share on other sites More sharing options...
abhi2011 Posted May 23, 2014 Share Posted May 23, 2014 Yes. 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