GUI Button to start game

Started by LadyFreotasor, Fri 14/06/2019 05:52:29

Previous topic - Next topic

LadyFreotasor

So I have started making my character creation screen and I cant for the life of me figure out how to make the "Confirm" button send you into the gamr (ie transfer the character to the proper room).  I've tried searching through the manual and the forum but I haven't been able to succesfully locate what I need.

thanks in advance!
HappyBoxStudios

Laura Hunt

Hey, so in the editor, click on the "Confirm" button you've created and look at the "Properties" panel on the right. Click on the little lightning bolt thingie and you'll see an event called YourButtonName_OnClick. Click on the three dots "..." and you'll be taken to the global script where a new empty function will have appeared. Just add the ChangeRoom command to that function, and I guess you want to make the character creation GUI invisible too:

Code: ags
function YourButtonName_OnClick(GUIControl *control, MouseButton button)
{
   gYourCharacterCreationGUI.Visible = false;
   player.ChangeRoom(insertnumberofstartingroomhere);
   
}

LadyFreotasor

HappyBoxStudios

SMF spam blocked by CleanTalk