POSN

Description

Position Cursor X,Y or +X or +Y or X, Y, Name/Page. The cursor can be positioned on the display using absolute co-ordinates or moved in relation to its current position by using +/- offset values. The origin is located at the top left of the screen. Re-position a previously placed entity by specifying the new coo-ordinates and it's name. This can be useful for indicator bars, simple movement animations and moving text. It may be necessary to place the cursor on another page to create a new entity.


Syntax/Parameters POSN(X,Y,Name/Page)

Move multiple entities at the same time - v47.12

Multiple entities can be moved at the same time POSN(x0,y0,Ent1,Ent2,Ent3,Ent4,...); POSN(+10,+10,Img1,keyup,keydn); moves both image and keys 10 pixels in X and Y direction This is useful for slider bars where the bar image, key up and key down objects move in sync.

Move with update=changed - v49.19

Movement of entities POSN(x,y,ent); when update=changed supported.

POSN in DRAW, IMG, TEXT and KEY Commands-vv49.37

    * Added initial positioning to commands:
  • DRAW(name,width,style,x,y); DRAW(name,width,height,style,x,y); DRAW(name,width,height,start,arc,style,x,y);
  • IMG(name,src,style,x,y);
  • TEXT(name,text,style,x,y);
  • KEY(name,func,width,height,style,x,y); KEY(name,downFunc,upFunc,width,height,style,x,y); KEY(name,downFunc,upFunc,repFunc,width,height,style,x,y);
Example:
POSN(+25,+0);  moves the cursor 25 pixels to the right.
POSN(236,48); absolute position of x=236, y=48.
POSN(24,56,CalcPage); position cursor on calc page at x=24, y=56.
POSN(VarX,Vary); use variables with absolute values to control position of cursor
POSN(VarX,Vary,VertBar); use variables to move an entity - vertical bar
POSN(TOUCHX,TOUCHY,MyRectCursor); move a cursor to the contact point on the screen. 

								
									STYLE(stPage, PAGE) { back=black; update=changed; }
									STYLE(stCircFg, DRAW) { type=Circle; col=white; }
									STYLE(stCircBg, stCircFg) { col=black; }
									 
									VAR(x,0,S16);
									VAR(y,0,S16);
									 
									PAGE(pgMain, stPage)
									{
									POSN(x,y);
									DRAW(circBg, 60, 60, stCircBg);
									DRAW(circFg, 60, 60, stCircFg);
									LOOP(lpMain, FOREVER)
									{
									POSN(x,y,circBg);
									LOAD(x,TOUCHX);
									LOAD(y,TOUCHY);
									POSN(x,y,circFg);;
									}
									}
									SHOW(pgMain);