Just a comment on the code, you should either use
const/
enum, or not use the all-caps convention associated with constants when they aren't.
Although,
const/
enum can be problematic since they just replace the variables at compile-time, so if you do anything dynamic with them it'll fail.
An alternative route would be to use a TStaticVar:
PHP Code:
this.anchors = new TStaticVar();
this.anchors.top = {screenwidth/2, 0};
this.anchors.topRight = {screenwidth, 0};
Glad you got it working though.