changing the way Outline is handled
This commit is contained in:
parent
f42c7564b9
commit
dbd06bda4e
6 changed files with 78 additions and 7 deletions
|
@ -15,6 +15,8 @@ import { TexturesHelper } from "../Helpers/TexturesHelper";
|
|||
import type { PictureStore } from "../../Stores/PictureStore";
|
||||
import { Unsubscriber, Writable, writable } from "svelte/store";
|
||||
import { createColorStore } from "../../Stores/OutlineColorStore";
|
||||
import type { OutlineableInterface } from '../Game/OutlineableInterface';
|
||||
import type { OutlineConfig } from '../../Utils/OutlineManager';
|
||||
|
||||
const playerNameY = -25;
|
||||
|
||||
|
@ -28,7 +30,7 @@ interface AnimationData {
|
|||
|
||||
const interactiveRadius = 35;
|
||||
|
||||
export abstract class Character extends Container {
|
||||
export abstract class Character extends Container implements OutlineableInterface {
|
||||
private bubble: SpeechBubble | null = null;
|
||||
private readonly playerNameText: Text;
|
||||
public playerName: string;
|
||||
|
@ -144,6 +146,17 @@ export abstract class Character extends Container {
|
|||
return { x: this.x, y: this.y };
|
||||
}
|
||||
|
||||
public getOutlineConfig(): OutlineConfig {
|
||||
return {
|
||||
thickness: 2,
|
||||
outlineColor: 0xffff00,
|
||||
}
|
||||
}
|
||||
|
||||
public getObjectToOutline(): Phaser.GameObjects.GameObject {
|
||||
return this.playerNameText;
|
||||
}
|
||||
|
||||
private async getSnapshot(): Promise<string> {
|
||||
const sprites = Array.from(this.sprites.values()).map((sprite) => {
|
||||
return { sprite, frame: 1 };
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue