   Begin a simple ui.
  Hi all,I'm writing my own engine in Directx and afterBasic SystemTerrain Rendering with subdivided meshes for cullingLoading and rendering char and evironment objectAnimationCollision Detect with aabb and pick an object in 3dEverythings quite about from scrath (with books and this forum offcourse :), I want to implement some kind of ui like 2 buttons (images done with photoshop) and 1 health bar. But i don't want to download a superimba gui library cause you can't understand nothing in this way and i'm not coding a game for commercial purpose (eheh offcourse) but i'm coding for learning. So where to start for 1 single images who can say when pressed: "hello" in debug output ? :)Thx for your time.   
  How did you do the other parts of your engine?The GUI isn't special, or magic. If you can display images, and do picking (telling if mouse is inside a rectangle), then you can work things out.What programming language do you use?Do you want windowing?How flexible do you want the GUI to be?   ;  Ok i readed again my question and understood that isn't a question at all.I'm using c++ and no i don't want windowing.Just static buttons and so.Anyway the basic idea is loading a texture, display a quad after setting ortho matrix for projection, then get track where the mousebutton was pressed and if is inside some buttons rectagle don't process with cast-ray for picking in 3d and otherwise..Can be ?   ;  Of course. There are a lot of kinds of GUI's AFAIK. And all are based on the thing you say.I did my own from total zero in two days. See signature.In case of mouse events (win32), a for loop checks which widget (rectangle) was clicked /released /whatever, then performs the assigned function. I did this by function pointers, which are assigned with functions at initialization. It's dead simple.It becomes trickier, if you have windowing, but that's not so hard either.   ;Quote:Original post by repka3Anyway the basic idea is loading a texture, display a quad after setting ortho matrix for projection, then get track where the mousebutton was pressed and if is inside some buttons rectagle don't process with cast-ray for picking in 3d and otherwise..That's basically it. Button's don't really get more complicated than that. Typically you will change the texture (or subtexture) when your mouse is over the button region, and change it to something else again if the mouse is over the region and the LMB (left mouse button) is down. Some games even skip the extra texture for when the LMB is down. And when the LMB comes up over the button after being down, you will do something (typically call some type of callback / notify an observer). Then you wrap the button stuff into a class so that you can reuse it and show numerous buttons. And if no UI widget claimed the mouse event, then it is, as you said, perhaps time to do some scene picking (depends on the game).   ;  thx @ szecs and lightbringer :)And sorry for my first question.   