Denz Posted December 30, 2014 Share Posted December 30, 2014 Hi, I have not been able to find tutorials on making GUI's, UI's and HUD's. I want to create a very simple GUI on the main menu for my game which some text you click on starts the game, goes to the options menu, credits, or exits the game. Also, for when you hover over the text it goes to for instance, the colour red (but not entirely needed, but would be great!). I hope someone can help me out here, it would make my day EDIT: This is what it should look like (just quickly done in paint): Quote Kind regards, Denz (Ryan) CEO & Founder of Denton Development (http://www.dentondev.net/) Link to comment Share on other sites More sharing options...
randomkeyhits Posted December 30, 2014 Share Posted December 30, 2014 Probably the easiest answer is to say buy Aggror's FlowGui and incorporate that. I did do a small tutorial showing a text input box which has some of the basic hud pasting elements. It can be found here If you are highlighting on mouse over then for each option create two textures, normal and highlighted, You know the top left corner and the size of each texture so in the PostRender stage use window:GetMousePosition() to find out the current mouse location. If the mouse maps within any of the three texture areas then for that texture choose the highlighted version. Quote content over form, game play over all. Link to comment Share on other sites More sharing options...
Denz Posted December 30, 2014 Author Share Posted December 30, 2014 Thanks for your reply, I will experiment with this tomorrow. I would happily buy Aggror's FlowGUI if I had the money. Quote Kind regards, Denz (Ryan) CEO & Founder of Denton Development (http://www.dentondev.net/) Link to comment Share on other sites More sharing options...
gamecreator Posted December 30, 2014 Share Posted December 30, 2014 Now sure if you're already familiar with the commands but you can use either DrawImage to draw textures/images on the screen or DrawText for text. Then you can use SetColor to change the color to whatever you'd like when the mouse is over a menu item. You can use Window commands to do mouse and/or keyboard detection. 2 Quote Link to comment Share on other sites More sharing options...
nick.ace Posted December 30, 2014 Share Posted December 30, 2014 Also, if you were going for a 3D menu, you can use raycasts to select a menu item (like if start, exit, options were actually 3D meshes or textures on those boxes). Quote Link to comment Share on other sites More sharing options...
Denz Posted December 30, 2014 Author Share Posted December 30, 2014 Thanks for your replies. I hardly even know LUA so I don't know where to begin with this. What I've done so far is drawn the text "Start, Options, Exit" onto the screen. If I could get help on where about to start this and some code to start from it'd be great. Quote Kind regards, Denz (Ryan) CEO & Founder of Denton Development (http://www.dentondev.net/) Link to comment Share on other sites More sharing options...
Imchasinyou Posted December 31, 2014 Share Posted December 31, 2014 Ive been playign with Aggrors FlowGUI a bit and here is something I threw together as an experiment. The great thing about the flowgui is that it is basically a map that a player would play. This allow me the easiest ability to make it my own with out a lot of coding which im unable to do very well. Im still trying to figure out how to make the start button and the quit button work but once I do, Ill rebuild this to make it smaller as size is apparently extremely important. https://www.youtube.com/watch?v=I2sBI40GEpA Quote Asus sabertooth 990FX, AMD FX 9590 , Windows 7 Home Premium 64 Bit, 4 HDD's Western Digital Caviar Black set in Raid 0, 16 GB Crucial Ballistix Elite, Asus Radeon R9 270 X 4GB, Corsair CM750M, Link to comment Share on other sites More sharing options...
Denz Posted December 31, 2014 Author Share Posted December 31, 2014 Unfortunately I do not have the money ATM for FlowGUI, hence why I am asked for help on a simple click drawn text that takes you to the start of the game. Quote Kind regards, Denz (Ryan) CEO & Founder of Denton Development (http://www.dentondev.net/) Link to comment Share on other sites More sharing options...
AggrorJorn Posted December 31, 2014 Share Posted December 31, 2014 Take a look at the following code: --Retrieve mouse coordinates local mousePos = App.window:GetMousePosition() --Check if the mouse.x is higher then the x position of the start text AND lower then the x position of the text end x. -- this also needs to be done for y axis if mousePos.x > button1.x and mousePos.x < (button1.x + button1Width) then System:Print("the position of the mouse is within the button ") end This image represent the code above. Since you want to check if the mouse is inside the button boundry, we have to perform these steps every frame. So the code needs to be placed either in UpdateWorld or in PostRender. For instance function Script:PostRender(context) local mousePos = App.window:GetMousePosition() if mousePos.x > 460 and mousePos.x < (460 + 100) then System:Print("the position of the mouse is within the button ") end App.context:SetColor(255, 255, 255) App.context:SetBlendMode(Blend.Alpha) App.context:DrawText("Start", 460, 280) App.context:SetBlendMode(Blend.Solid) end 2 Quote Link to comment Share on other sites More sharing options...
tjheldna Posted January 1, 2015 Share Posted January 1, 2015 Don't forget I've created this GUI system for the C++ users. http://www.leadwerks.com/werkspace/files/file/537-tjui-31/ I've actually optimised it a hell of a lot since this build so when I have a sec I'll update it. 2 Quote Link to comment Share on other sites More sharing options...
Denz Posted January 1, 2015 Author Share Posted January 1, 2015 I'll attempt to do this again later this week. Don't forget I've created this GUI system for the C++ users. http://www.leadwerks.com/werkspace/files/file/537-tjui-31/ I've actually optimised it a hell of a lot since this build so when I have a sec I'll update it. I only have the indie edition. Quote Kind regards, Denz (Ryan) CEO & Founder of Denton Development (http://www.dentondev.net/) Link to comment Share on other sites More sharing options...
epsilonion Posted January 5, 2015 Share Posted January 5, 2015 I so wish i had the money to upgrade to standard right now.. Quote Link to comment Share on other sites More sharing options...
epsilonion Posted January 14, 2015 Share Posted January 14, 2015 Try this http://www.leadwerks.com/werkspace/topic/11576-help-with-start-menu/ Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.