feat: Добавлена текстура фонового изображения
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { Container, Graphics, Sprite, Text } from 'pixi.js';
|
||||
import { CONTAINER_HEIGHT, CONTAINER_WIDTH } from './config';
|
||||
import { Ball } from './entities/ball/ball';
|
||||
import { Brick } from './entities/brick/brick';
|
||||
import { Paddle } from './entities/paddle/paddle';
|
||||
@@ -74,6 +75,11 @@ function createPerkView(perk) {
|
||||
*/
|
||||
export function createGameView(game, container, textures) {
|
||||
try {
|
||||
const background = new Sprite(textures['/sprites/background_1.png']);
|
||||
background.width = CONTAINER_WIDTH;
|
||||
background.height = CONTAINER_HEIGHT;
|
||||
container.addChildAt(background, 0);
|
||||
|
||||
const header = new Text({ style: { fill: '#ffffff', fontSize: 16 } });
|
||||
header.x = 8;
|
||||
header.y = 8;
|
||||
|
||||
Reference in New Issue
Block a user