Welcome,
Guest
. Please
login
or
register
. Did you miss your
activation email?
French forum
Home
Help
Search
Login
Register
SFML community forums
»
Help
»
Graphics
»
setOrigin( ), good or bad?
Print
Pages: [
1
]
Author
Topic: setOrigin( ), good or bad? (Read 1331 times)
0 Members and 1 Guest are viewing this topic.
Snizzlenose
Newbie
Posts: 7
setOrigin( ), good or bad?
«
on:
May 30, 2015, 06:38:58 pm »
Should you keep the origin as it is in the top left corner or change it to say center mass of your sprite / shape?
I assume this depends on preference, but does it come with implications further on?
Logged
eXpl0it3r
SFML Team
Hero Member
Posts: 11032
Re: setOrigin( ), good or bad?
«
Reply #1 on:
May 30, 2015, 06:51:47 pm »
It doesn't matter. Do whatever is easier.
Logged
Official FAQ:
https://www.sfml-dev.org/faq.php
Official Discord Server:
https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog:
https://duerrenberger.dev/blog/
Nexus
SFML Team
Hero Member
Posts: 6287
Thor Developer
Re: setOrigin( ), good or bad?
«
Reply #2 on:
May 31, 2015, 11:17:06 am »
Quote from: Snizzlenose on May 30, 2015, 06:38:58 pm
but does it come with implications further on?
Yes. The origin is not only the reference point for translation, but also for rotation and scale. If you need those transforms, you usually want the origin to be the object's center.
Logged
Zloxx II
: action platformer
Thor Library
: particle systems, animations, dot products, ...
SFML Game Development
:
Print
Pages: [
1
]
SFML community forums
»
Help
»
Graphics
»
setOrigin( ), good or bad?