Back

%PLUGINNAME%

Todo: Documentation for %PLUGINNAME%

In order to use %PLUGINNAME%, you must first load the plugin at the top of your script using the LoadPlugin method like this:

 app.LoadPlugin( "%PLUGINNAME%" );

Then you can create an instance of the plugin object when you need it like this:

 plg = app.Create%PLUGINNAME%();

Examples:

Example - Get Version

app.LoadPlugin( "%PLUGINNAME%" );

function OnStart()
{
  lay = app.CreateLayout( "Linear", "VCenter,FillXY" );

  btn = app.CreateButton( "Press Me" );
  btn.SetOnTouch( CallPlugin );
  lay.AddChild( btn );

  plg = app.Create%PLUGINNAME%();

  app.AddLayout( lay );
}

function CallPlugin()
{
  alert( plg.GetVersion() );
}

  Copy   Copy All    Run   

Example - Call MyFunc

app.LoadPlugin( "%PLUGINNAME%" );

function OnStart()
{
  lay = app.CreateLayout( "Linear", "VCenter,FillXY" );

  btn = app.CreateButton( "Press Me" );
  btn.SetOnTouch( CallPlugin );
  lay.AddChild( btn );

  plg = app.Create%PLUGINNAME%();

  app.AddLayout( lay );
}

function CallPlugin()
{
  var ret = plg.MyFunc( "hello", 21, true );
  app.ShowPopup( ret );
}
  Copy   Copy All    Run