User Tools

Site Tools


Sidebar

Privacy Policy

News

Version 2.50 is out since Jan 1st 2022


Frequently Asked Questions


Namespaces

Note for contributors

If you wish to create a new page in the DroidScript wiki, please click on the most appropriate namespace above and follow the notes for contributors there.

Because of spam, it has been necessary to add a CAPTCHA to the registration form and the save option for editing pages. You will not need to prove you are human if you are logged in, so please register.

Please feel free to improve any existing page, as well as adding new pages to increase the sum of public knowledge about DroidScript.

Formatting Syntax

plugins:microbit_getimage

GetImage

The GetImage function Returns full path to micro:bit board top view image micro-bit.png.

Return is string: “/data/user/0/com.smartphoneremote.androidscriptfree/app_Plugins/microbit/micro-bit.png”

It could be used as visualization of board. It is used by MicroBitCtrl.

// Load the MicroBit plugin.
app.LoadPlugin( "MicroBit" );
 
// Called when application is started.
function OnStart()
{
  // Lock screen orientation to Portrait.
  app.SetOrientation( "Portrait" );
 
  // Create our main layout.
  lay = app.CreateLayout( "Linear", "VCenter,FillXY" );
  lay.SetBackColor( "#222222" );
 
  // Create the Microbit plugin.
  microbit = app.CreateMicroBit();
 
  // Creates micro:bit board image with 90% of layout width
  img = app.CreateImage( microbit.GetImage(), 0.9, -1 );
  lay.AddChild( img );  
 
  //Add main layout to the app.
  app.AddLayout( lay );
}
plugins/microbit_getimage.txt · Last modified: 2016/10/25 17:48 (external edit)