I try to make simple app with pixi.js and ang18.
import { Component, OnInit } from '@angular/core';
import * as PIXI from 'pixi.js';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.scss']
})
export class AppComponent implements OnInit {
// app!: PIXI.Application;
title = 'game';
constructor() {}
ngOnInit(): void {
const app = new PIXI.Application();
let type = "WebGL";
if (!PIXI.isWebGLSupported()) {
type = "canvas";
}
//Add the canvas that Pixi automatically created for you to the HTML document
document.body.appendChild(app.canvas);
PIXI.sayHello('HELLO');
}}
Compilation is well but I got blank page. Could yoy please help me to find answer: why I can't see HELLO text.