Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Unable to set position  (Read 10053 times)

0 Members and 1 Guest are viewing this topic.

Luhrel

  • Newbie
  • *
  • Posts: 2
    • View Profile
Unable to set position
« 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

picnic

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: Unable to set position
« Reply #1 on: April 07, 2016, 10:27:26 pm »
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
"


Luhrel

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: Unable to set position
« Reply #2 on: April 08, 2016, 10:59:36 am »
Yes, it's:
mySprite.position = Vector2f(x, y);

 

anything