takis_GUI

BlitzMax Forums/MaxGUI Module/takis_GUI

Takis76(Posted 2012) [#1]
Hello ,

I am attempting to create my own in game gui plugin or module name is as you want, from scratch.

I have purchased the iGlass and ifsoGui modules and both are open source and I am studying to understand how the mechanics work , to understand how the classes work , how the lists work , i discover that I can put functions and methods inside types.

I am in the first attempt of creating my first gadget the window gadget.

So far I don't see any graphic , but the code compiled.
I can call my first window creation function and worked.

My Gui module will be named as takisGui.

I will try to make it as simple as I can , the module will be only one huge source code .bmx file and you will just include it in your games and you will have one complete in game GUI.

Is very very very early to say much , I am inspiring and taking ideas from source of iGlass and ifsoGui and trying to understand how mechanics work and learn the BlitzMAX language better.

My first function interface worked.

One example how my window command will be created.
Global main_window:takisGUI_Window
main_window = takisGUI_Window.create("Some title",10,10,500,200)


This code above is the interface code.


This is the source code of my super GUI engine so far.

'This file is all takisGUI engine

Global takisGUI_WindowList:TList = CreateList() 'This holds all of my windows of my gui in one list

Type takisGUI_Widget

	Field id:Object	' The current object ID
	Field title:String 'The current window title
	
	Field pos_X:Int	' Position X of the current window
	Field pos_Y:Int ' Position Y of the current window
	Field width:Int ' Width size of the current window
	Field Height:Int 'Height size of the current window
	
EndType

Type takisGUI_Window Extends takisGUI_Widget

	Function Create:takisGUI_Window(title:String, pos_X:Int, pos_Y:Int, width:Int, Height:Int)

		Local my_Window:takisGUI_Window
		my_Window = New takisGUI_Window
		my_Window.id = my_Window
		my_Window.title = title
		my_Window.pos_X = pos_X
		my_Window.pos_Y = pos_Y
		my_Window.width = width
		my_Window.Height = Height


		' --------------------------
		' Add this window to the windows list
		' --------------------------
		ListAddLast takisGUI_WindowList, my_Window
			
		Return my_Window
	End Function

EndType


It does nothing , only create one window object in the memory and add this window in my windows list.

Tell me if I am wrong. Thank you.

This might will be a complete in game GUI in the future with all kinds of gadgets which are missing from commercial GUI modules.

Everytime I will add something I will update this post , as there are a lots of things that I don't understand and I look the source code of ifsoGui and iGlass to see how things happen.

Then if I understand completely the mechanics I will add the missing gadgets in existing GUIs.

Last edited 2012


SystemError51(Posted 2012) [#2]
I will try to make it as simple as I can , the module will be only one huge source code .bmx file


If you plan to make the source available to people, I think that will put people off. I prefer to divide the GUI library I'm implementing in my own engine in smaller parts - each GUI element has its own file. Window, Button, Text Label, Secure Text Field, Image View, and so on... are all separated code files.

I believe that as you will progress on to create all the single elements, it is, in fact, better to separate the source files into smaller chunks. Primarily to be organized.


Takis76(Posted 2012) [#3]
I am in the very early stages and trying to understand the code from other modules source codes.

I will see , the single file will have all functions organized and commended.

I don't know if I will make it , I am making experiment trying to create one complete GUI system for my level editor of my game.

Now I try to understand how to skin my existing window and make it appear on the screen.

There is not much documentation which explains other things like classes and more advanced techniques. I just see other peoples code and try to guess or understand their codes.

Last edited 2012