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

Author Topic: SetPosition and delta-time  (Read 1238 times)

0 Members and 1 Guest are viewing this topic.

JasonMcG

  • Newbie
  • *
  • Posts: 10
    • View Profile
SetPosition and delta-time
« on: October 04, 2017, 07:49:43 pm »
Hi,

If I am using move(x, y), I know yo should multiply by delta-time to ensure the frame rate is correct.

If I am using setPosition(x, y), do I still need to use delta time?
If so, how would I use delta-time?

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11016
    • View Profile
    • development blog
    • Email
Re: SetPosition and delta-time
« Reply #1 on: October 04, 2017, 08:53:55 pm »
How do you determine x and y?
Do you really understand the concept of multiplying by delta time? Because it has nothing to do with the function that gets called.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Hapax

  • Hero Member
  • *****
  • Posts: 3379
  • My number of posts is shown in hexadecimal.
    • View Profile
    • Links
Re: SetPosition and delta-time
« Reply #2 on: October 05, 2017, 02:18:47 pm »
"move(offset)" is effectively just "setPosition(getPosition() + offset)" so multiply your delta time in the same way (with the offset only).
Selba Ward -SFML drawables
Cheese Map -Drawable Layered Tile Map
Kairos -Timing Library
Grambol
 *Hapaxia Links*