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

Author Topic: Get size of content  (Read 2033 times)

0 Members and 1 Guest are viewing this topic.

delio

  • Newbie
  • *
  • Posts: 49
    • View Profile
    • Email
Get size of content
« on: May 02, 2014, 03:55:22 pm »
At first, Content's width is 50 px.


Then, I zoom in. So contents are bigger. It's width is 100px


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

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11033
    • View Profile
    • development blog
    • Email
Re: Get size of content
« Reply #1 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.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

delio

  • Newbie
  • *
  • Posts: 49
    • View Profile
    • Email
Re: Get size of content
« Reply #2 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.

zsbzsb

  • Hero Member
  • *****
  • Posts: 1409
  • Active Maintainer of CSFML/SFML.NET
    • View Profile
    • My little corner...
    • Email
Re: Get size of content
« Reply #3 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.
Motion / MotionNET - Complete video / audio playback for SFML / SFML.NET

NetEXT - An SFML.NET Extension Library based on Thor

delio

  • Newbie
  • *
  • Posts: 49
    • View Profile
    • Email
Re: Get size of content
« Reply #4 on: May 02, 2014, 07:02:38 pm »
Thanks  :) , zsbzsb and eXpl0it3r