我正在创造一个玩家可以移动的世界游戏.
还有一些GUI(eq,stats ..),其元素没有背景(背景是游戏世界).
这些元素有黑色文字颜色,我的问题是:
当背景为黑色时,此文本是否可以变为白色,或者此文本是否总是与背景颜色相反?
我有示例类:
class Something{
constructor(x, y){
this.x = x;
this.y = y;
}
//...
}
Run Code Online (Sandbox Code Playgroud)
当我将这样继承的类:
class Dog extends Something{
constructor(name){
this.name = name;
}
//...
}
Run Code Online (Sandbox Code Playgroud)
Will Dog的构造函数看起来像这样吗?
constructor(x, y, name){
this.x = x;
this.y = y;
this.name = name;
}
Run Code Online (Sandbox Code Playgroud)
如果没有,是否有可能让它像这样工作^?