 | Code: VARABLES: [Name] [Description] [Note] [Example] nButtonPressed -1: none, 0..31: ID of pressed button Is set only when you press or release button nxtDisplayStringAt(80, 32, "%d", nButtonPressed); nButtonOver -1: none, 0..31: ID of button under cursor Is set every 40 msec nxtDisplayStringAt(80, 32, "%d", nButtonOver);
FUNCTIONS: [Name] [Description] [Example] init(int t=S1, int mX=motorB, int mY=motorC, int sX=50, int sY=-50) Initialisation init(S1, motorB, motorC, 50, -50); t: port of Touch sensor init() mX/mY: port of Motor X/Y sX/sY: Speed of cursor
createButton(int ID, int left, int top, int right, int bottom, string text, Creates rectangular button createButton(5, 85, 45, 95, 35, "/"); TAlign align=alignCenter, TValign valign=valignCenter) ID: ID of button createButton(3, 3, 61, 50, 43, "3", alignLeft, valignTop); left, top, right, bottom: position text: text. If too long, is truncated align: alignLeft, alignCenter or alignRight valign: valignTop, valignCenter or valignBottom createButtonCircle(int ID, int x, int y, int radius, string text) Creates circular button createButton(5, 85, 45, 95, 35, "/"); ID: ID of button createButton(3, 3, 61, 50, 43, "3", alignLeft, valignTop); x, y, radius: position text: text. If too long, is truncated
void deleteButton(int ID); Deletes button deleteButton(i); ID: ID of button
void deleteAllButtons(); Deletes all buttons deleteAllButtons();
|  |