Click or drag to resize

Scripting Overview

Getting StartedManual / Scripting OverviewNeoAxis Levels

Scripting Overview

The NeoAxis editor includes a rich set of tools for scripting. Following methods for scripting are supported: classic C# programming, C# scripts, visual workflow scripting, advanced object types creation capabilities.

ImageContents
ImageBuilt-in classic C# programming

In addition to classic C# programming by using typical IDEs, such as Visual Studio, the engine editor has a built-in C# editor. This gives additional possibilities for object scripting. For example, you can script scenes, GUI files, make event handlers same way as IDEs doing.

Read more.

Screenshot999999999999999579.png
Screenshot999999999999999580.png
ImageC# scripts

There is a lighter way of scripting in the engine, which is called C# scripts. It's significantly different from usual C# programming. Scripts have some advantages over C# programming: those are easier to read, easier to embed, and those require less programming skills.

C# script is a simple C# code, but it lacks a class description, and it does not define used namespaces. Only class components are described (methods, attributes, fields). This is the main difference between C# script and usual C# file. C# script is a kind of abstract file, it does not even have a name.

Screenshot999999999999999581.png
ImageC# script simple example

Following image features simple C# script. The code contains a definition of the method.

Screenshot999999313.png

The next image shows a somewhat more complex script, which consists of two methods. One of those methods is public.

Screenshot999999318.png
ImageC# script integration

C# scripts is a part of a basic functional of NeoAxis Engine. In addition to the built-in script editor, there are special components for their integration.

In the image below the example of a simple script. The rotation of the sky is animated depending on the time. Skybox object has nested script component. Skybox's rotation field is bound to 'Method'. So now, every time the Rotation field is requested, it would call a script's 'Method'. This method will be executed during rendering, when skybox's parameters would be requested.

Screenshot999999314 2.png

Here's the script's code.

Screenshot999999313.png
ImageFlow graph scripting

Engine editor supports visual programming of logic via Flow Graph Editor. It is a node editor, that allows to adjust the interactions between objects visually.

Following images display event handler for an object in space. First image demonstrates how to add an event handler for a selected object.

Screenshot999999323 2.png

The second image shows the graph editor, which describes event handler.

Screenshot999999324.png
ImageMaterial scripting

Graph editor can be used as a base for other specialized editors. For example, in the engine, graph editor used for Material Editor.

Screenshot999999194.png
ImageMixing different types of scripting

It is possible to mix up usual C#, C# scripts, and visual programming. Following image shows an example of using C# script in the graph.

Screenshot999999315.png
ImageType and metadata programming

NeoAxis Engine environment provides opportunities for object type modification. By 'object types' the ability of adjusting and reusing objects as a type is implied. From the programming perspective that is the ability to classes creation, inheritance, and other OOP features in a visual manner. NeoAxis Engine editor has fully functional environment for this kind of programming.

Read more.

Screenshot999999331.png
ImageC/C++

Native languages, like C/C++ are also supported. One needs to use PInvoke or C++/CLI.

ImageConclusion

NeoAxis Engine environment has a rich and complete toolset for scripting. Abilities to mix usual C# code, C# scripts and visual programming provide powerful and comfortable means for developing. Object type creation capabilities extend the editor's concept.

ImageSee also
Getting StartedNeoAxis Levels