mirror of
https://github.com/sigmasternchen/88x31breakout
synced 2025-03-15 07:59:00 +00:00
some positioning stuff
This commit is contained in:
parent
446c0343e1
commit
fdfe6d7bb1
3 changed files with 13 additions and 1 deletions
|
@ -1,10 +1,12 @@
|
|||
|
||||
#game {
|
||||
width: 500px;
|
||||
width: 1000px;
|
||||
height: 500px;
|
||||
background-color: red;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.banner {
|
||||
margin: 1px;
|
||||
position: absolute;
|
||||
}
|
|
@ -14,6 +14,8 @@ export class Banner {
|
|||
|
||||
this.element = document.createElement("img");
|
||||
this.element.classList.add("banner");
|
||||
this.element.style.top = this.position.y + "px";
|
||||
this.element.style.left = this.position.x + "px";
|
||||
}
|
||||
|
||||
public load(): Promise<void> {
|
||||
|
|
|
@ -7,4 +7,12 @@ export class Position {
|
|||
this._x = x;
|
||||
this._y = y;
|
||||
}
|
||||
|
||||
get x(): number {
|
||||
return this._x;
|
||||
}
|
||||
|
||||
get y(): number {
|
||||
return this._y;
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue