Adding input field to Settings

Help, support and information for our Game Framework Unity Asset.
If posting about the assets in the extras bundle then please use the appropriate forum.
Post Reply
bradjensen68
Posts: 67
Joined: Thu Dec 08, 2016 7:34 pm

Adding input field to Settings

Post by bradjensen68 » Thu Jul 26, 2018 5:00 pm

Hello!

I looked at the menu tutorials and they seem to be mostly about changing the appearance of the existing menus. I would like to add two input fields to the "settings" dialog. One would allow the player to enter their name, and the other to choose their country. How do I even start doing that? I created an input box that showed in the editor, but then it disappeared (disabled) once I started the game.

mahewitt
Site Admin
Posts: 273
Joined: Thu May 05, 2016 8:06 pm

Re: Adding input field to Settings

Post by mahewitt » Fri Jul 27, 2018 7:30 pm

Hi,

Should be pretty straight forward 'once you know how'. You will need to create a subclass of FlipWebApps/GameFramework/Scripts/UI/Dialogs/Components/Settings.cs and replace the old Settinsg component with your new one on the settingd prefab instance. You can then override the GameSetup, Show and DoneCallback methods to provide for setting / saving your own settings. If you take a look at the exiting settings.cs class then you can see how it is done for the existing items - you just need to add similar for your own.

Regards,
Mark

bradjensen68
Posts: 67
Joined: Thu Dec 08, 2016 7:34 pm

Re: Adding input field to Settings

Post by bradjensen68 » Mon Aug 27, 2018 9:11 pm

:( This is a bit too hard for me to grasp. Can you explain it to me like I am five? Image

mahewitt
Site Admin
Posts: 273
Joined: Thu May 05, 2016 8:06 pm

Re: Adding input field to Settings

Post by mahewitt » Sun Sep 02, 2018 6:00 pm

Haha. :D

Try taking a look at the script FlipWebApps/GameFramework/_Demo/About/Scripts/CustomSettings.cs which does just this. Let me know if that doesn't help clarify things :)

Post Reply