cubeQry2.qry

  Download

More scripts: Style By Script

Syntax Highlighing:

comments, key words, predefined symbols, class members & methods, functions & classes
            
# CubeQry2
# Point CartoScript to draw red 3D cube symbol
# with a label (from database) in a text box.
# Script from Using CartoScripts tutorial.
# Set dimensions of cube symbol
width = 15;
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 = 10;		angle = 0;		border = 2;
# 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);