SFML community forums

Help => General => Topic started by: delio on May 02, 2014, 03:55:22 pm

Title: Get size of content
Post by: delio on May 02, 2014, 03:55:22 pm
At first, Content's width is 50 px.
(http://upic.me/i/9l/5capture.png)

Then, I zoom in. So contents are bigger. It's width is 100px
(http://upic.me/i/e1/1capture1.png)

How can I get contents' width, when I've zoom?

I've try "view.getSize" .
but While Contents are bigger, "view.getSize.x" is lower.

delio
Title: Re: Get size of content
Post by: eXpl0it3r on May 02, 2014, 04:01:04 pm
Sorry I've no idea what you're asking for...
If you want the zoom factor, then you need to track that on your own.
Title: Re: Get size of content
Post by: delio on May 02, 2014, 04:03:33 pm
Sorry I've no idea what you're asking for...
If you want the zoom factor, then you need to track that on your own.
Sorry for bad explanation.
Ok I'll try it.
Title: Re: Get size of content
Post by: zsbzsb on May 02, 2014, 04:44:05 pm
Taking a shot in the dark... but leading off what eXpl0it3r said. If your content is 50px wide and you zoom to a factor of 150% (1.5). Then your content will be 75 pixels wide. The formula is simple, value * scale. Just multiply whatever the original size is by the scale/zoom factor and you should be set.
Title: Re: Get size of content
Post by: delio on May 02, 2014, 07:02:38 pm
Thanks  :) , zsbzsb and eXpl0it3r