Jump to content

Lets talk GTA.Forms


Recommended Posts

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. :D

 

Thanks in advance guys for taking the time.

 

Later!

Link to comment
https://gtaforums.com/topic/775631-lets-talk-gtaforms/
Share on other sites

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 by LetsPlayOrDy
Link to comment
https://gtaforums.com/topic/775631-lets-talk-gtaforms/#findComment-1067129466
Share on other sites

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 by Finney
Link to comment
https://gtaforums.com/topic/775631-lets-talk-gtaforms/#findComment-1067130107
Share on other sites

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 by AgentWD40
Link to comment
https://gtaforums.com/topic/775631-lets-talk-gtaforms/#findComment-1067131994
Share on other sites

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • 0 User Currently Viewing
    0 members, 0 Anonymous, 0 Guests

×
×
  • Create New...

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.