1- import { Point , Container , Graphics , HTMLText } from "pixi.js" ;
1+ import { Point , Container , Graphics , HTMLText , Assets , Sprite } from "pixi.js" ;
22import { HEIGHT , TEXT_FONT , theme , WIDTH } from "../constants" ;
33import { container } from "../util" ;
44import GameNode from "./GameNode" ;
5+ import ministryLogoPath from "../assets/img/ministry-logo.png" ;
56
67export default class Credits extends GameNode {
78 onFinish ?: ( ) => void ;
@@ -60,7 +61,7 @@ export default class Credits extends GameNode {
6061 "Oliver Schön"
6162 ) ;
6263 this . drawCredit (
63- new Point ( width , - HEIGHT * 0.15 ) ,
64+ new Point ( width , - HEIGHT * 0.125 ) ,
6465 "Arcade Machine Graphic Design" ,
6566 "Eric Londaits"
6667 ) ;
@@ -69,7 +70,7 @@ export default class Credits extends GameNode {
6970 "Arcade Machine Building" ,
7071 "Retr-O-Mat"
7172 ) ;
72- this . drawCredit ( new Point ( 0 , HEIGHT * 0.1 ) , "Funded by" , "BMFTR" ) ;
73+ // this.drawCredit(new Point(0, HEIGHT * 0.1), "Funded by", "BMFTR");
7374 }
7475
7576 drawCredit ( position : Point , title : string , ...names : string [ ] ) {
@@ -110,4 +111,28 @@ export default class Credits extends GameNode {
110111 document . removeEventListener ( "keydown" , this . handleKeyDown ) ;
111112 this . onFinish ?.( ) ;
112113 } ;
114+
115+ async load ( ) {
116+ const fundedBy = new Container ( ) ;
117+ fundedBy . position = { x : - WIDTH * 0.2 , y : HEIGHT * 0.2 } ;
118+ const ministryLogoTexture = await Assets . load ( ministryLogoPath ) ;
119+ const titleText = new HTMLText ( {
120+ text : "Funded by" ,
121+ style : {
122+ align : "center" ,
123+ fill : theme . colors . primary ,
124+ fontFamily : TEXT_FONT ,
125+ fontWeight : "bold" ,
126+ fontSize : 40 ,
127+ } ,
128+ } ) ;
129+ titleText . anchor = { x : 0.5 , y : 0 } ;
130+ fundedBy . addChild ( titleText ) ;
131+ const sprite = new Sprite ( ministryLogoTexture ) ;
132+ sprite . anchor = { x : 0.5 , y : 0 } ;
133+ sprite . position . y = 50 ;
134+ sprite . scale = 0.3 ;
135+ fundedBy . addChild ( sprite ) ;
136+ this . view . addChild ( fundedBy ) ;
137+ }
113138}
0 commit comments