Finney Posted March 15, 2015 Share Posted March 15, 2015 Hey guys. I'm interested in adding buttons, textboxs - and all the standard forms. I've noticed that GTA also hosts its own forms (aside from Windows.Forms)... I was wondering if anyone had a good read on GTA.Forms and proper use - or if someone would mind giving me a simple example? C# of course. I've toyed around with trying to set up a simple GTA.Forms.Textbox, and buttons, and other thigns - with bad results (... well ... no results). I've tried making them into several methods, trying different things - and I've tried to locate material... I only found one VB written example that was kinda written wrong, so I didn't really want to try to toy with that. I'm running a bit short on time, and most likely won't see this till tomorrow, but just something to get me setup and on screen, a example method or something of that nature would be really all I need to get the ball rolling - even if its very basic... I'm literally just failing to setup right. Thanks in advance guys for taking the time. Later! Link to comment https://gtaforums.com/topic/775631-lets-talk-gtaforms/ Share on other sites More sharing options...
uNi Posted March 15, 2015 Share Posted March 15, 2015 What are you talking about exactly? Link to comment https://gtaforums.com/topic/775631-lets-talk-gtaforms/#findComment-1067129460 Share on other sites More sharing options...
Jitnaught Posted March 15, 2015 Share Posted March 15, 2015 (edited) GTA does not host it's own version of Windows.Forms, it's .NET Scripthook that implements this. I myself have never delved into GTA.Forms, but my guess into using it is GTA.Forms.Button button = new GTA.Forms.Button();button.Text = "Click me";button.Location = new System.Drawing.Point(Game.Resolution.Width / 2 - button.Size.Width / 2, Game.Resolution.Height / 2 - button.Size.Height / 2); //center of screenbutton.Click += button_Click; //create function for thisbutton.Visible = true;This is 100% untested as I am busy at the moment, but when I get time I'll research it (if it isn't confirmed that it works/is confirmed that it doesn't work). What are you talking about exactly?He put this in the wrong section. Edited March 15, 2015 by LetsPlayOrDy Link to comment https://gtaforums.com/topic/775631-lets-talk-gtaforms/#findComment-1067129466 Share on other sites More sharing options...
Finney Posted March 15, 2015 Author Share Posted March 15, 2015 (edited) GTA does not host it's own version of Windows.Forms, it's .NET Scripthook that implements this. I myself have never delved into GTA.Forms, but my guess into using it is GTA.Forms.Button button = new GTA.Forms.Button();button.Text = "Click me";button.Location = new System.Drawing.Point(Game.Resolution.Width / 2 - button.Size.Width / 2, Game.Resolution.Height / 2 - button.Size.Height / 2); //center of screenbutton.Click += button_Click; //create function for thisbutton.Visible = true;This is 100% untested as I am busy at the moment, but when I get time I'll research it (if it isn't confirmed that it works/is confirmed that it doesn't work). What are you talking about exactly? He put this in the wrong section. ... Are you serious? LMFAO I DID IT AGAIN!? Damnit man I'm making ass of myself... Ok I was wondering. I had to make sure I declared it a GTA.Forms.Button when using it, rather then a System.Windows.Forms. I'm pretty comfortable with Windows.Forms, but I was just having ZERO luck getting a display in game using the GTA.Forms. I'm out of time, but I just couldn't resist checking back... damnit.. now... if I could just... post in the right ... section. :| PS to the admin, I am so damn sorry. I'm clearly over looking a topics section when I make my posts... Edited March 15, 2015 by Finney uNi 1 Link to comment https://gtaforums.com/topic/775631-lets-talk-gtaforms/#findComment-1067130107 Share on other sites More sharing options...
AgentWD40 Posted March 15, 2015 Share Posted March 15, 2015 (edited) I came across this useful form helper created by CoMPMStR, would help with positioning items visually in form. http://gtaforums.com/topic/392325-beta-gtaiv-net-scripthook/page-51?do=findComment&comment=1059476991 GTA.Form Menu Teleporter - http://pastebin.com/DZLLVdKm Edited March 15, 2015 by AgentWD40 Link to comment https://gtaforums.com/topic/775631-lets-talk-gtaforms/#findComment-1067131994 Share on other sites More sharing options...
Finney Posted March 15, 2015 Author Share Posted March 15, 2015 I came across this useful form helper created by CoMPMStR, would help with positioning items visually in form. http://gtaforums.com/topic/392325-beta-gtaiv-net-scripthook/page-51?do=findComment&comment=1059476991 GTA.Form Menu Teleporter - http://pastebin.com/DZLLVdKm This is good - this is kind of what I was after also, just a coded example of how to get the Forms up and running. Link to comment https://gtaforums.com/topic/775631-lets-talk-gtaforms/#findComment-1067132402 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