playMaker

Author Topic: [solved] Button that triggers Closing the App?  (Read 1996 times)

Col. Phil Bilko

  • Playmaker Newbie
  • *
  • Posts: 45
    • View Profile
[solved] Button that triggers Closing the App?
« on: April 13, 2011, 05:20:30 AM »
Hello all;

How would I have a button once clicked to quit the app? I have the button setup, just having an issue with triggering this... All help would be appreciated.

Thanks in advance.

Bilko
« Last Edit: April 15, 2011, 01:18:51 PM by alexchouls »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 12342
  • Official Playmaker Support
    • View Profile
Re: Button that triggers Closing the App?
« Reply #1 on: April 13, 2011, 05:42:55 AM »
Hi,

 I can't find any pre made actions for this. If there is then can someone point it?

 Meanwhile, I scripted one. You can get the code here http://hutonggames.com/playmakerforum/index.php?topic=113.0

1: In your project Panel, open Playmaker/Actions/
2: Create a new c# script
3: Rename it ApplicationQuit
4: copy the code from the link above
5: select your button fsm
6: Select the State that needs to quit the app
7: browse the actions under the GameLogic tab and select ApplicationQuit and add it to your State
8: now if you run, and reach that State, it will quit the application.

 If you have any questions, do not hesitate:)

Bye,

 Jean
« Last Edit: April 13, 2011, 07:26:33 AM by jeanfabre »

Col. Phil Bilko

  • Playmaker Newbie
  • *
  • Posts: 45
    • View Profile
Re: Button that triggers Closing the App?
« Reply #2 on: April 13, 2011, 05:51:03 AM »
PERFECT!!!!

Thanks ever so much! Works like a charm! (God I need to learn code hahaha)

Regards;

Bilko

MaDDoX

  • 1.2 Beta
  • Full Member
  • *
  • Posts: 165
    • View Profile
    • FluidPlay Studios
Re: Button that triggers Closing the App?
« Reply #3 on: April 13, 2011, 06:44:28 AM »
Nice jeanfabre! Guys, if it isn't asking much, could we add all new actions to the proper section (http://hutonggames.com/playmakerforum/index.php?board=19.0) and just link to them in the questions that required them? That'd make things easier to find/maintain (in case some bug is found or you want to update the action) and tidier.

Thanks!
--
Breno "MaDDoX" Azevedo
@brenoazevedo

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 12342
  • Official Playmaker Support
    • View Profile
Re: Button that triggers Closing the App?
« Reply #4 on: April 13, 2011, 07:25:31 AM »
Done,

 I whish we had some better official wiki system, cause even if it goes in the right section, maintaining code base in a forum is just wrong anyway.. but yes, in the right section now :) Obviously, the team is really busy and can't really afford playing on all sides, so if they'd let us build up a proper code base and documentation as we discuss things, double win!

 Bye,

 Jean

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 3204
  • Official Playmaker Support
    • View Profile
    • LinkedIn
Re: Button that triggers Closing the App?
« Reply #5 on: April 13, 2011, 01:35:47 PM »
We're working on a public section on the playmaker wiki... should be up tonight!