我正在使用SFML 2.5。
由于sf :: CircleShape继承自sf :: Shape,因此我想知道为什么此代码不起作用:
sf::Shape *c;
c = new sf::CircleShape;
c->setRadius(60);
请注意,setRadius是CircleShape成员,编译器告诉我:
main.cpp(51): error C2039: 'setRadius': is not a member of 'sf::Shape'
c:\sfml-2.5.0\include\sfml\graphics\shape.hpp(44): note: see declaration of 'sf::Shape'
我是c ++新人,感谢您的答复!