Syntax Highlighing:
comments, key words, predefined symbols, class members & methods, functions & classes
# CubeQry3
# Point CartoScript to draw red 3D cube symbol
# with a label (from database) in a text box
# with units set to millimeters at display scale.
# Script from Using CartoScripts tutorial.
# Set dimensions of cube symbol
LineStyleSetCoordType(1)
width = 4;
depth = 0.5 * width;
height = width;
# Set color for cube faces
red = 255; green= 0; blue = 0;
# Draw cube symbol
LineStyleSetColor(0,0,0); # line color for edges
LineStyleSetLineWidth(0);
LineStyleDrawCube(width,depth,height,red,green,blue);
# Read sample number from database field and convert
# to text string for use as a label
Label$ = sprintf("%d", Samples.Number);
# String variable for label text font
Font$ = "ARIALBD.TTF";
# Define color variables for text
tred = 0; tgreen= 0; tblue = 0;
# Define fill color variables for text box
fillred = 255; fillgreen = 255; fillblue = 170;
# Define height, angle, and border width of text
t_height = 4; angle = 0; border = 0.5;
# Set color and font for text label
LineStyleSetTextColor(tred,tgreen,tblue,fillred, fillgreen, fillblue);
LineStyleSetFont(Font$);
# Move pen to right of symbol and draw label
LineStyleMoveTo(0, width * 1.2);
LineStyleDrawTextBox(Label$,t_height,angle,border,0);