Can I manipulate the "Design" of the ForceArrows with Thyme?

About advanced scenes, and the Thyme scripting language used in Algodoo.

Can I manipulate the "Design" of the ForceArrows with Thyme?

Postby dobili » Mon Sep 21, 2015 9:12 am

Hi guys,

Sometimes I wish I could redesign the ForceArrows. What I would love to do is:
  • Change the textcolor of the Forcevalues
  • Start "automatic size refitting" of the arrows via Thyme
  • Let the y-component of an force be drawn that way the foot lies on the tip of the x-component

Is anything of this possible?
dobili
 
Posts: 9
Joined: Tue May 26, 2015 10:52 pm

Re: Can I manipulate the "Design" of the ForceArrows with Thyme?

Postby T'wind_ » Mon Sep 21, 2015 8:45 pm

You can change the scale of the arrows with App.GUI.Forces.forceScale = ;
User avatar
T'wind_
 
Posts: 86
Joined: Wed Jul 08, 2015 5:33 pm
Location: Western Europe

Re: Can I manipulate the "Design" of the ForceArrows with Thyme?

Postby dobili » Sat Sep 26, 2015 12:45 pm

Thank you for your answer,
I already use this possible in this function:

Code: Select all
scene.my.scaleVelVectors = (RaiseOrLower, hold) => {
   _vel := math.max(scene.my.ActValues(1), scene.my.ActValues(2));

   _vel > 0 ? {
      _max := 1.5/_vel;
      _step := false;
      hold ? {
         _step = 0.02/_vel;
      }:{
         _step = 0.25/_vel;
      };
      _newscale := APP.GUI.Forces.VelScale+RaiseOrLower*_step;
      
      _newscale > _max ? {
         APP.GUI.Forces.VelScale = 0;
      }:{
         _newscale < 0 ? {
            APP.GUI.Forces.VelScale = _max;
         }:{
            APP.GUI.Forces.VelScale = _newscale;
         };
      };
   }:{};
};


It was the best solution I could imagine, because I couldn't find a possibility to use the autoscalefunction of Algodoo. :(
dobili
 
Posts: 9
Joined: Tue May 26, 2015 10:52 pm


Return to Thyme scripting

Who is online

Users browsing this forum: No registered users and 13 guests

cron