Add unused Signal. private textStyle for labels
This commit is contained in:
parent
065a69a475
commit
ad9167528a
11
src/Signal.ts
Normal file
11
src/Signal.ts
Normal file
@ -0,0 +1,11 @@
|
||||
import * as PIXI from 'pixi.js';
|
||||
|
||||
export default class Signal {
|
||||
public location: PIXI.Point;
|
||||
|
||||
constructor(
|
||||
location: PIXI.Point,
|
||||
) {
|
||||
this.location = location;
|
||||
}
|
||||
}
|
@ -71,6 +71,8 @@ export default class Station {
|
||||
public label: PIXI.Text;
|
||||
public color: tinycolorInstance;
|
||||
|
||||
private textStyle: object;
|
||||
|
||||
constructor(
|
||||
location: PIXI.Point,
|
||||
population: number,
|
||||
@ -85,10 +87,15 @@ export default class Station {
|
||||
// for debugging
|
||||
stationCount += 1;
|
||||
this.id = stationCount;
|
||||
this.label = new PIXI.Text(`${this.id}`, {
|
||||
this.textStyle = {
|
||||
fill: '#FFA500',
|
||||
fontFamily: 'monospace',
|
||||
fontSize: '12px',
|
||||
});
|
||||
};
|
||||
this.renderLabel();
|
||||
}
|
||||
|
||||
public renderLabel() {
|
||||
this.label = new PIXI.Text(`${this.id}`, this.textStyle);
|
||||
}
|
||||
}
|
||||
|
11
src/Train.ts
11
src/Train.ts
@ -15,6 +15,8 @@ export default class Train {
|
||||
public color: tinycolorInstance;
|
||||
public sprite: PIXI.Sprite;
|
||||
|
||||
private textStyle: object;
|
||||
|
||||
constructor(
|
||||
location: PIXI.Point,
|
||||
speed: number,
|
||||
@ -35,15 +37,20 @@ export default class Train {
|
||||
// for debugging
|
||||
trainCount += 1;
|
||||
this.id = trainCount;
|
||||
this.label = new PIXI.Text(`${this.id}`, {
|
||||
this.textStyle = {
|
||||
fill: '#AEAEAE',
|
||||
fontFamily: 'monospace',
|
||||
fontSize: '12px',
|
||||
});
|
||||
};
|
||||
this.renderLabel();
|
||||
}
|
||||
|
||||
public boardPassengers() {
|
||||
if (this.location === this.origin.location) { // about to leave a station
|
||||
}
|
||||
}
|
||||
|
||||
public renderLabel() {
|
||||
this.label = new PIXI.Text(`${this.id}`, this.textStyle);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user