Difference between revisions of "Kray3 SDK/Script basics"

From Kray
Jump to: navigation, search
m (Script Basics)
(Functions)
Line 19: Line 19:
 
== Functions ==
 
== Functions ==
  
<tt> function MyFunction(string text,var num){  
+
  function MyFunction(string text,var num){  
echo Function args are +text+ and +num;  
+
      echo Function args are +text+ and +num;  
}</tt>
+
}
  
 
== Loops and Conditional statements ==
 
== Loops and Conditional statements ==

Revision as of 10:53, 15 August 2012

Script Basics

Welcome to Kray3 Script! Kray script is scripting language that allows you to control Kray render engine. It is very easy to use it so anyone can try it, although any previous programming background experience will come handy.

In this first section we will explore basic data types and operations that you can use in Kray Script.

Data Types

Numbers

Double

Double is a type of variable for numbers. It contains twice as many binary digits.

Vector

Matrix

Arithmetic operations

Variables

Functions

 function MyFunction(string text,var num){ 
     echo Function args are +text+ and +num; 
}

Loops and Conditional statements

There are two statements available in Kray script: IF and WHILE:

while

Executes code as long as condition is true

while {....}

if

Executes code if condition is true.

if {... }

Common commands

echo

help