public class Font : SDLTTF.Font {
public Font (string _filename, int _size) {
}
public void draw () {
}
}
那是我的代码。当我尝试构建它时,我得到:
Font.vala:4.5-4.15: error: unable to chain up to base constructor requiring arguments
public Font (string _filename, int _size) {
^^^^^^^^^^^
Compilation failed: 1 error(s), 0 warning(s)
我以为我需要重写构造函数,所以我尝试了public override
它,但现在我得到了:
Font.vala:4.5-4.24: error: abstract, virtual, and override modifiers are not applicable to creation methods
public override Font (string _filename, int _size) {
^^^^^^^^^^^^^^^^^^^^
Compilation failed: 1 error(s), 0 warning(s)
有想法该怎么解决这个吗?我正在尝试继承 SDLTTF.Font 类。