Jump to content

Oberon Object Tiler [repack] -

PROCEDURE (t: Tile) Draw*; VAR r: Rectangle; BEGIN r := t.frame; Objects.DrawObj(t.obj, r.x, r.y, r.w, r.h); END Draw; PROCEDURE LayoutGrid*(tiles: Tiles.List); VAR i, cols, rows, cw, ch: INTEGER; BEGIN cols := ENTIER(SQRT(Len(tiles))); rows := (Len(tiles) + cols - 1) DIV cols; cw := Display.Width DIV cols; ch := Display.Height DIV rows; FOR i := 0 TO Len(tiles)-1 DO tiles[i].frame := Rect( (i MOD cols)*cw, (i DIV cols)*ch, cw, ch ); END END LayoutGrid;

[3] Pike, R. (1991). Acme: A User Interface for Programmers. Proc. of the Winter 1991 USENIX Conference . oberon object tiler

[1] Wirth, N., & Gutknecht, J. (1992). Project Oberon – The Design of an Operating System and Compiler . Addison‑Wesley. PROCEDURE (t: Tile) Draw*; VAR r: Rectangle; BEGIN r := t

×
×
  • Create New...