SFML community forums
Bindings - other languages => D => Topic started by: Luhrel on April 07, 2016, 08:09:37 pm
-
Hello.
In my code when I do:
mySprite.position = new Vector2(x, y);
I have this error:
Error: struct dsfml.system.vector2.Vector2(T) if (isNumeric!T) is used as a type
dmd failed with exit code 1.
x and y are int.
What's incorrect ? What should I do ?
i'm using DSFML 2.1
-
I think the answer is here:
http://www.sfml-dev.org/documentation/2.0/classsf_1_1Vector2.php#details
"the most common specializations have special typedefs:
sf::Vector2<float> is sf::Vector2f
sf::Vector2<int> is sf::Vector2i
"
-
Yes, it's:
mySprite.position = Vector2f(x, y);