Table Of Contents

Graph IDEProgramming ► Overview

Graphics are programmed using a general purpose scripting language. To see examples view the PalettesPrograms menu which shows scripted and animated examples that are ready to drag and drop for use. The scripting language can be extended using a Plugin. The goal is to keep it simple yet very powerful. Before delving into serious programming issues, lets take a look at a script to animate setting colors of a circle.

/* Declarations */

@@class() Circle:Object

@@method(public, class) (id)alloc;
@@method(public, instance) (id)init;
@@method(public, instance) (unsigned)animationCount;
@@method(public, instance) (void)setCurveRed:(double)red green:(double)green blue:(double)blue alpha:(double)alpha;
@@method(public, instance) (void)setInteriorRed:(double)red green:(double)green blue:(double)blue alpha:(double)alpha;
@@method(public, instance) (void)release;

@@end

/* Execution Block */

{
id myCircle;
int ii;
unsigned animationCount;
double red, green;

myCircle = [[Circle alloc] init];

animationCount = [myCircle animationCount];

red = (animationCount % 10) / 10.0;
green = (animationCount % 20) / 20.0;

[myCircle setInteriorRed:1.0 green:green blue:1.0 alpha:1.0];
[myCircle setCurveRed:red green:1.0 blue:1.0 alpha:1.0];

[myCircle release];

}

If you know the C language and the Objective-C language then you can immediately see what is happening in the script. The first part, Declarations, defines the API that will be used and the second part, Execution Block, is what is executed when the script runs. Lets focus on the execution block. The following are the main points:

At this point, you have been exposed to an overview of the way to program graphics. The rest of the programming sections deal with programming specifications.




© Copyright 1993-2022 by VVimaging, Inc. (VVI); All Rights Reserved. Please email support@vvi.com with any comments you have concerning this documentation. See Legal for trademark and legal information.