Welcome,
Guest
. Please
login
or
register
. Did you miss your
activation email?
French forum
Home
Help
Search
Login
Register
SFML community forums
»
Help
»
Graphics
»
What has replaced the Image function GetWidth() in SFML 2.0
Print
Pages: [
1
]
Author
Topic: What has replaced the Image function GetWidth() in SFML 2.0 (Read 3546 times)
0 Members and 1 Guest are viewing this topic.
ZeroAndOne
Newbie
Posts: 6
What has replaced the Image function GetWidth() in SFML 2.0
«
on:
December 30, 2012, 09:09:35 am »
I have a sprite sheet that I would like to animate by subdividing it into sub-rectangles but I am unable to,
because the function getWidth() for the sprite sheet has been removed in SFML 2.0 and I don't know what has replaced it.
«
Last Edit: December 30, 2012, 09:14:29 am by Laurent
»
Logged
Laurent
Administrator
Hero Member
Posts: 32498
Re: What has replaced the Image function GetWidth() in SFML 2.0
«
Reply #1 on:
December 30, 2012, 09:14:54 am »
Is getSize() really difficult to find by looking at the API documentation?
Logged
Laurent Gomila - SFML developer
ZeroAndOne
Newbie
Posts: 6
Re: What has replaced the Image function GetWidth() in SFML 2.0
«
Reply #2 on:
December 30, 2012, 09:31:45 am »
but isn't getSize() going to return the whole size of the image in Kbs or MBs? I want the number of pixels across the image and also the number of pixels on the height of the image. will getSize() be able to achieve this? If Yes. How?
Logged
Laurent
Administrator
Hero Member
Posts: 32498
Re: What has replaced the Image function GetWidth() in SFML 2.0
«
Reply #3 on:
December 30, 2012, 09:51:52 am »
The doc says that it returns the "
size in pixels
" (not in KB or MB), and the return value is a Vector2 (a pair of <x, y> values). So it returns exactly what you want: getSize().x is the width, getSize().y is the height.
Logged
Laurent Gomila - SFML developer
ZeroAndOne
Newbie
Posts: 6
Re: What has replaced the Image function GetWidth() in SFML 2.0
«
Reply #4 on:
December 30, 2012, 09:53:30 am »
thanks, I get it now.
Logged
Laurent
Administrator
Hero Member
Posts: 32498
Re: What has replaced the Image function GetWidth() in SFML 2.0
«
Reply #5 on:
December 30, 2012, 09:55:00 am »
I'll update the documentation to make this more explicit.
Logged
Laurent Gomila - SFML developer
Print
Pages: [
1
]
SFML community forums
»
Help
»
Graphics
»
What has replaced the Image function GetWidth() in SFML 2.0