Refactor screen layout code, start player progress code
This commit is contained in:
@ -91,6 +91,10 @@ export class Rect {
|
||||
this.size = size;
|
||||
}
|
||||
|
||||
offset(offset: Point) {
|
||||
return new Rect(this.top.offset(offset), this.size);
|
||||
}
|
||||
|
||||
contains(other: Point) {
|
||||
return (other.x >= this.top.x && other.y >= this.top.y && other.x < this.top.x + this.size.w && other.y < this.top.y + this.size.h);
|
||||
}
|
||||
@ -186,5 +190,5 @@ export enum AlignX {
|
||||
export enum AlignY {
|
||||
Top = 0,
|
||||
Middle = 1,
|
||||
Right = 2,
|
||||
Bottom = 2,
|
||||
}
|
||||
|
Reference in New Issue
Block a user