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 label: PIXI.Text;
|
||||||
public color: tinycolorInstance;
|
public color: tinycolorInstance;
|
||||||
|
|
||||||
|
private textStyle: object;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
location: PIXI.Point,
|
location: PIXI.Point,
|
||||||
population: number,
|
population: number,
|
||||||
@ -85,10 +87,15 @@ export default class Station {
|
|||||||
// for debugging
|
// for debugging
|
||||||
stationCount += 1;
|
stationCount += 1;
|
||||||
this.id = stationCount;
|
this.id = stationCount;
|
||||||
this.label = new PIXI.Text(`${this.id}`, {
|
this.textStyle = {
|
||||||
fill: '#FFA500',
|
fill: '#FFA500',
|
||||||
fontFamily: 'monospace',
|
fontFamily: 'monospace',
|
||||||
fontSize: '12px',
|
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 color: tinycolorInstance;
|
||||||
public sprite: PIXI.Sprite;
|
public sprite: PIXI.Sprite;
|
||||||
|
|
||||||
|
private textStyle: object;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
location: PIXI.Point,
|
location: PIXI.Point,
|
||||||
speed: number,
|
speed: number,
|
||||||
@ -35,15 +37,20 @@ export default class Train {
|
|||||||
// for debugging
|
// for debugging
|
||||||
trainCount += 1;
|
trainCount += 1;
|
||||||
this.id = trainCount;
|
this.id = trainCount;
|
||||||
this.label = new PIXI.Text(`${this.id}`, {
|
this.textStyle = {
|
||||||
fill: '#AEAEAE',
|
fill: '#AEAEAE',
|
||||||
fontFamily: 'monospace',
|
fontFamily: 'monospace',
|
||||||
fontSize: '12px',
|
fontSize: '12px',
|
||||||
});
|
};
|
||||||
|
this.renderLabel();
|
||||||
}
|
}
|
||||||
|
|
||||||
public boardPassengers() {
|
public boardPassengers() {
|
||||||
if (this.location === this.origin.location) { // about to leave a station
|
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