Is there any documentation which describes which properties the Quick texts in Dash Studio are using?
Or, how to get the value from any widget at runtime (via a widget property) using the javascript option?
For example, I tried to implement a fx to change the text color for "Live delta to best" based on positive or negative value.
Also, I tried using a simple formula by getting two props (current lap time, best lap time) and subtracting them but it seems like math on javascript variables which are from these props aren't numeric (simple time math not the correct approach).
I know c, c++, js, and other languages very well so it's not the coding part. It's the doc part I'm missing.
Thanks,
Mike
Hi ! The "quick texts" philosophy is to give a precomputed value with no ncalc involved in this way it's not possible to get back the displayed value (which is already a text and can't be used anymore for computations anyway). About "times" in a general manner it's stored as a timespan (a time interval storage) to use it in computations you can use the timespantoseconds method which will convert it to a number and make it "computations friendly".
Nicolas
@admin5435 Thanks for the info.
I tried some simple code but it's giving a different value from the quick texts so I must not have the correct props.
var bsec = 0.0;
var esec = 0.0;
root['tkcBestDelta'] = 0.0;
if ($prop('DataCorePlugin.GameRunning')) {
bsec = timespantoseconds($prop('BestLapTime'));
esec = timespantoseconds($prop('PersistantTrackerPlugin.EstimatedLapTime'));
root['tkcBestDelta'] = bsec - esec;
}
return root['tkcBestDelta'].toFixed(2);
Also, I noticed that storing data in the root dictionary doesn't persist across fx. For example, if I get the value of root['tkcBestDelta'] from the fx for TextColor it's always null even though my text is showing values. I thought it was essentially global?
Thanks again,
Mike