NetLizard
Mana drag kodi ozimizni DS dasturidayam bor:
  1.  app.LoadPlugin( "Support" );  function OnStart()
  2.  {
  3.  lay = app.CreateLayout( "Linear", "VCenter,FillXY" );
  4.  
  5.  sup = app.CreateSupport();
  6.  
  7.  left = app.CreateButton( "Left" );
  8.  left.EnableDrag( "DragButton", OnDragStart );
  9.  lay.AddChild( left );
  10.  
  11.  right = app.CreateButton( "Right", 0.4, 0.4 );
  12.  right.SetTag( "RightButton" );
  13.  right.On( "drag", OnDrag );
  14.  lay.AddChild( right );
  15.  
  16.  app.AddLayout( lay );
  17.  }
  18.  
  19.  function OnDrag( action, tag )
  20.  {
  21.  
  22.  switch( action )
  23.  {
  24.  case "Start": lay.SetBackColor( color.RED );break;
  25.  case "Enter": lay.SetBackColor( color.GREEN ); break;
  26.  case "Exit": lay.SetBackColor( color.RED ); break;
  27.  case "Drop":
  28.   if( tag == "RightButton" ) right.SetText( "Dropped" );
  29. break;
  30.  case "Stop": lay.SetBackColor( "Black" ); break;
  31.  }
  32.  
  33.  }
  34.  
  35.  function OnDragStart( tag )
  36.  {
  37.  console.log( "Start Drag For: "+tag );
  38.  }