Question about text field features

82 views
Skip to first unread message

DogPlanner GSS

unread,
Apr 6, 2026, 7:33:49 AMApr 6
to DroidScript
Dear Developers,

We have a small question about possibilities of text field. Is it possible to change and add new fonts for texts (in the native mode)? And one more - is it possible to make running test line in the text field?

Thank you very much in advance.

Have a nice day!

Best regards
Dmitry

Alan Hendry

unread,
Apr 6, 2026, 1:13:25 PMApr 6
to DroidScript
HI,

On native Text fields you can SetFontFile
(docs don't show it as available for TextEdit).

Text fields have SetEllipsize("marq")
I presume that does automatic horizontal scrolling of text

Regards, ah

DogPlanner GSS

unread,
Apr 7, 2026, 6:00:19 AMApr 7
to DroidScript
Dear Alan,

thank you very much for the fast answer!

Have a nice day.

Best regards
Dmitry

понедельник, 6 апреля 2026 г. в 20:13:25 UTC+3, hendr...@gmail.com:

DogPlanner GSS

unread,
Jun 17, 2026, 10:42:24 AM (9 days ago) Jun 17
to DroidScript
Dear Developers,

we made the running line in our app and want to share our way of solving this problem:

// Variables for moving line of today events
var initialString = "What we planned for today?.... Nothing?! Pls rest:)))";
var initialShortString = "";
var transformString = "";
var stringFromEnd = "";

function OnStart() {

   // First horizontal lines for Title text
   layHoriz = app.CreateLayout( "Linear", "Horizontal");

   const today = new Date();
    
   movingLineString( today.getDate() );

    // Calendar title with running text line
    txtTodayEvents = app.CreateText(  initialString );
    txtTodayEvents.SetMargins(0.01, 0.03);
    txtTodayEvents.SetTextSize( 14 );
    txtTodayEvents.SetTextColor( "black" );
    layHoriz.AddChild(txtTodayEvents);

   app.AddLayout( layHoriz );

   accelerometerInitializing();
}

function accelerometerInitializing() {
 
    // Create and start accelerometer sensor
    snsAcc = app.CreateSensor( "Accelerometer", "Fast" );
    snsAcc.Start();
       
    // Get data
    var vals = snsAcc.GetValues();
    var series = GetSeries( sampleCount, [vals[1],vals[2],vals[3]] );
  
    app.HideProgress();        
             
    // Start updating the graph
    Update();
 }

 // Updating accelerometer readings
function Update() {

    // Get more data
    var vals = snsAcc.GetValues();
    var series = GetSeries( sampleCount, [vals[1],vals[2],vals[3]] );
       
    txtDateInfo.SetText( "Gyroscope Data:\n" +
                    "X: " + vals[1] + "\n" +
                    "Y: " + vals[2] + "\n" +
                    "Z: " + vals[3] + "\n");      
   
    // Reading new sensors data
    let newX=Math.round(vals[1]);
    let newY=Math.round(vals[2]);
    let newZ=Math.round(vals[3]);
   
   animationPlus++;
   if( animationPlus % 10 == 0) {
   
        movingLineEffect();
   }

    // Call this function again
    setTimeout( Update, updateInterval );
}

function movingLineEffect() {
   
    let strLength = initialShortString.length;
   
    if(strLength!=0) {
       
          stringFromEnd = stringFromEnd + initialShortString.slice(0, 1);
          initialShortString = initialShortString.slice(1);
     } else {
     
          initialShortString = initialString;
          stringFromEnd = "";
     }

    transformString = initialShortString+" " + stringFromEnd;

    txtTodayEvents.SetText( transformString );
}

It is the simple algorithm  with removing the first character of the string and immediately adding that character at the end. All of this are tied to updating the accelerometer readings, and in the future, e.g. we can link the direction of the running line depending on where our smartphone is directed.

Have a nice day. We hope this info can help to somebody in their projects.

Best regards
Dmitry


вторник, 7 апреля 2026 г. в 13:00:19 UTC+3, DogPlanner GSS:
Reply all
Reply to author
Forward
0 new messages