1- import { Container , Graphics } from "pixi.js" ;
1+ import { Container , Graphics , HTMLText } from "pixi.js" ;
22import { container } from "../util" ;
33import GameNode from "./GameNode" ;
44import type { Piece } from "./Deck" ;
55import QubitPair from "./QubitPair" ;
6- import { CELL_SIZE } from "../constants" ;
6+ import { CELL_SIZE , TEXT_FONT , theme } from "../constants" ;
77
8+ const header = 75 ;
89const width = 200 ;
910const height = 200 ;
1011export default class HoldArea extends GameNode {
@@ -14,11 +15,24 @@ export default class HoldArea extends GameNode {
1415 super ( ) ;
1516 this . view . scale = 0.75 ;
1617 this . view . addChild (
17- container ( new Graphics ( ) . roundRect ( 0 , 0 , width , height ) )
18+ container ( new Graphics ( ) . roundRect ( 0 , 0 , width , header + height ) )
1819 ) ;
1920
2021 this . view . addChild ( this . container ) ;
21- this . container . position = { x : 100 , y : 100 } ;
22+ const text = new HTMLText ( {
23+ text : "HOLD" ,
24+ style : {
25+ fill : theme . colors . primary ,
26+ stroke : { color : theme . colors . background , width : 10 } ,
27+ fontFamily : TEXT_FONT ,
28+ fontWeight : "bold" ,
29+ fontSize : 48 ,
30+ } ,
31+ } ) ;
32+ text . anchor = { x : 0.5 , y : 0.5 } ;
33+ text . position = { x : width / 2 , y : header / 2 } ;
34+ this . view . addChild ( text ) ;
35+ this . container . position = { x : width / 2 , y : header + height / 2 } ;
2236 }
2337
2438 setHold ( piece : Piece ) {
0 commit comments