index of project core

Module core

SynopsisThe core TkScript API.

Functions

Classes


Description:
 

This is a set of classes and functions that are built into the TkScript engine.
Some of the classes are also available (as a stripped-down version) in the YAC plugin API.
Function ceil
Round to next bigger integer
Signature
ceil(floatf)
 :float
Arguments
floatf
Returns
float

 
 top of page
Function exit
Exit with the given return code
Signature
exit(intreturn)
Arguments
intreturn

 
 top of page
Function floor
Round to next smaller integer
Signature
floor(floatf)
 :float
Arguments
floatf
Returns
float

 
 top of page
Function GetCurrentThread
Query current thread object
Signature
GetCurrentThread():Thread
Returns
ThreadCurrent Thread object
Description

TkScript must have been compiled with thread local storage support (HAVE_TLS) or this function will always return null.

See also:  


 
 top of page
Function getenv
Get environment variable
Signature
getenv(Stringname)
 :String
Arguments
Stringname
Returns
String
Description

This is a wrapper for the getenv() native function.

 
 top of page
Function lcchar
Convert character to lower case
Signature
lcchar(charc)
 :char
Arguments
charc
Returns
char

 
 top of page
Function mathAbsMaxf
Return the bigger absolute float value
Signature
mathAbsMaxf(floatx,
  floaty 
  )  
 :float
Arguments
floatx
floaty
Returns
float

 
 top of page
Function mathAbsMinf
Return the smaller absolute float value
Signature
mathAbsMinf(floatx,
  floaty 
  )  
 :float
Arguments
floatx
floaty
Returns
float

 
 top of page
Function mathAbsMini
Return the bigger absolute integer value
Signature
mathAbsMini(intx,
  inty 
  )  
 :int
Arguments
intx
inty
Returns
int

 
 top of page
Function mathAbsMini
Return the smaller absolute integer value
Signature
mathAbsMini(intx,
  inty 
  )  
 :int
Arguments
intx
inty
Returns
int

 
 top of page
Function mathCerpf
Return cosine interpolation of values a and b according to t (0..1)
Signature
mathCerpf(floata,
  floatb,
  floatt 
  )  
 :float
Arguments
floata
floatb
floatt
Returns
float

 
 top of page
Function mathClampf
Clamp value to min/max range
Signature
mathClampf(floata,
  floatb,
  floatc 
  )  
 :float
Arguments
floata
floatb
floatc
Returns
float

 
 top of page
Function mathClampi
Clamp value to min/max range
Signature
mathClampi(inta,
  intb,
  intc 
  )  
 :int
Arguments
inta
intb
intc
Returns
int

 
 top of page
Function mathDistancePointPlane2d
Return distance of point p to infinite plane.
Signature
mathDistancePointPlane2d(floatpx,
  floatpy,
  floatqx,
  floatqy,
  floatnx,
  floatny 
  )  
 :float
Arguments
floatpxa point
floatpya point
floatqxa point on the plane
floatqya point on the plane
floatnxthe plane normal
floatnythe plane normal
Returns
floatdistance of point to plane
Description

 
q is a point on the plane and n is the plane normal.

 
 top of page
Function mathFoldf
Fold value into min/max range
Signature
mathFoldf(floata,
  floatb,
  floatt 
  )  
 :float
Arguments
floata
floatb
floatt
Returns
float

 
 top of page
Function mathFoldi
Fold value into min/max range
Signature
mathFoldi(inta,
  intb,
  intt 
  )  
 :int
Arguments
inta
intb
intt
Returns
int

 
 top of page
Function mathGCD
Return greatest common divisor via Euclidean algorithm
Signature
mathGCD(intx,
  inty 
  )  
 :int
Arguments
intx
inty
Returns
int

 
 top of page
Function mathLerpCyclicf
Cyclic interpolation
Signature
mathLerpCyclicf(floatx,
  floaty,
  floatc,
  floatt 
  )  
 :float
Arguments
floatx
floaty
floatcCycle interval (e.g. 2PI or 360)
floatt
Returns
floatinterpolated value

 
 top of page
Function mathLerpf
Return linear interpolation of values a and b according to t (0..1) (a + (b-a)*t)
Signature
mathLerpf(floata,
  floatb,
  floatt 
  )  
 :float
Arguments
floata
floatb
floatt
Returns
float

 
 top of page
Function mathMaxf
Return bigger value
Signature
mathMaxf(floatx,
  floaty 
  )  
 :float
Arguments
floatx
floaty
Returns
float

 
 top of page
Function mathMaxi
Return bigger value
Signature
mathMaxi(intx,
  inty 
  )  
 :int
Arguments
intx
inty
Returns
int

 
 top of page
Function mathMinf
Return smaller value
Signature
mathMinf(floatx,
  floaty 
  )  
 :float
Arguments
floatx
floaty
Returns
float

 
 top of page
Function mathMini
Return smaller value
Signature
mathMini(intx,
  inty 
  )  
 :int
Arguments
intx
inty
Returns
int

 
 top of page
Function mathNextCyclicf
Return next 'n' (shortest distance between last 'c' and next 'n' with cyclic period = 'cycle', e.g. 360.0 or "PI)
Signature
mathNextCyclicf(floatc,
  floatn,
  floatcycle 
  )  
 :float
Arguments
floatccurrent value
floatnnext value
floatcyclePeriod len, e.g. 360.0 or 2PI
Returns
float

 
 top of page
Function mathPowerf
Return x raised to the power of y.
Signature
mathPowerf(floatx,
  floaty 
  )  
 :float
Arguments
floatx
floaty
Returns
float
Description

This is different to pow() in regard to negative 'x': mathPowerf() returns (sign(x) * pow(abs(x), y)).

 
 top of page
Function mathPowerfC
Return x raised to the power of y (pow())
Signature
mathPowerfC(floatx,
  floaty 
  )  
 :float
Arguments
floatx
floaty
Returns
float

 
 top of page
Function mathPoweri
Return x raised to the power of y
Signature
mathPoweri(intx,
  inty 
  )  
 :int
Arguments
intx
inty
Returns
int

 
 top of page
Function mathSerpf
Return sine interpolation of values a and b according to t (0..1)
Signature
mathSerpf(floata,
  floatb,
  floatt 
  )  
 :float
Arguments
floata
floatb
floatt
Returns
float

 
 top of page
Function mathSmoothStepf
Return smooth-step interpolation of values a and b according to s (0..1) (a*(1-t)+b*t, with t=(s*s*(3-2*s)) )
Signature
mathSmoothStepf(floata,
  floatb,
  floats 
  )  
 :float
Arguments
floata
floatb
floats
Returns
float

 
 top of page
Function mathSmoothStepNf
Return (higher-order) smooth-step interpolation of values a and b. n must be in the range (0..6).
Signature
mathSmoothStepNf(floata,
  floatb,
  floats,
  intn 
  )  
 :float
Arguments
floata
floatb
floats
intn
Returns
float

 
 top of page
Function mathWrapf
Wrap value around min/max range
Signature
mathWrapf(floata,
  floatb,
  floatt 
  )  
 :float
Arguments
floata
floatb
floatt
Returns
float

 
 top of page
Function mathWrapi
Wrap value around min/max range
Signature
mathWrapi(inta,
  intb,
  intt 
  )  
 :int
Arguments
inta
intb
intt
Returns
int

 
 top of page
Function milliSeconds
Return milliseconds since system start
Signature
milliSeconds():int
Returns
int

 
 top of page
Function milliSecondsDouble
For profiling purposes only, cannot be used to measure long time spans.
Signature
milliSecondsDouble(Doubled)
Arguments
DoubledPreallocated Double object that will be used to store the timestamp

 
 top of page
Function psystem
Invoke system command
Signature
psystem(Stringcmd,
  characcess,
  Stringbuf 
  )  
 :int
Arguments
StringcmdCommand line
characcessr to read result to buf, w to read input from buf
StringbufInput resp. output buffer
Returns
intNumber of bytes read resp. written

 
 top of page
Function putenv
Set environment variable
Signature
putenv(Stringname)
 :String
Arguments
Stringname
Returns
String
Description

This is a wrapper for the putenv() native function.

 
 top of page
Function srand
Set random seed
Signature
srand(intseed)
Arguments
intseed

 
 top of page
Function system
Invoke system command
Signature
system(Stringcmd)
Arguments
StringcmdCommand line

 
 top of page
Function ucchar
Convert character to upper case
Signature
ucchar(charc)
 :char
Arguments
charc
Returns
char

 
 top of page

Project Modules:core 
Project Classes:Boolean , Buffer , Byte , Class , ClassArray , Condition , Configuration , Double , DummyStream , Envelope , Event , Exception , File , Float , FloatArray , FloatArray128 , FloatArray16 , FloatArray32 , FloatArray64 , FloatArray8 , Function , HashTable , IntArray , IntArray128 , IntArray16 , IntArray32 , IntArray64 , IntArray8 , Integer , LFSR , LFSR_NR , List , ListNode , Long , Mailbox , Mutex , Object , ObjectArray , PakFile , PointerArray , Pool , Process , Script , SharedBuffer , Short , Stack , StdErrStream , StdInStream , StdOutStream , Stream , String , String128 , String16 , String32 , String64 , String8 , StringArray , StringIterator , Thread , Time , TKS , TreeNode , UnsignedByte , UnsignedInteger , UnsignedLong , UnsignedShort , Value , ValueArray , Variable 
Project Functions:ceil , exit , floor , GetCurrentThread , getenv , lcchar , mathAbsMaxf , mathAbsMinf , mathAbsMini , mathAbsMini , mathCerpf , mathClampf , mathClampi , mathDistancePointPlane2d , mathFoldf , mathFoldi , mathGCD , mathLerpCyclicf , mathLerpf , mathMaxf , mathMaxi , mathMinf , mathMini , mathNextCyclicf , mathPowerf , mathPowerfC , mathPoweri , mathSerpf , mathSmoothStepf , mathSmoothStepNf , mathWrapf , mathWrapi , milliSeconds , milliSecondsDouble , psystem , putenv , srand , system , ucchar 
All Namespaces:default , graph , ui 
All Projects:core , eqxmms , ShaderVG , ShaderVG_Text , tkanalogrytm , tkchipmunk , tkclap , tkfileutils , tkfreeglut , tkfreetype2 , tkfreeverb , tkmath , tkmidi , tkmidipipe , tkminnie , tkoldmath , tkopengl , tkportaudio , tkradiastools , tksamplechain , tksampleedit , tksampler , tksdl , tksdl_net , tksidplay2 , tkspeexdsp , tksqlite , tktriangulate , tkui , tkvst2 , tkzip , ui , yingtest 


 
 top of page

auto-generated by "DOG", the TkScript document generator. Thu, 11/Dec/2025 13:41:59