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

Author Topic: [Solved]100% pixel perfect sf::View size?  (Read 3774 times)

0 Members and 1 Guest are viewing this topic.

Ashenwraith

  • Sr. Member
  • ****
  • Posts: 270
    • View Profile
[Solved]100% pixel perfect sf::View size?
« on: June 25, 2010, 11:09:21 am »
I tried this but it doesn't work: sf::Vector2f HalfSize(App.GetWidth()*.5f,App.GetHeight()*.5f);

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
[Solved]100% pixel perfect sf::View size?
« Reply #1 on: June 25, 2010, 11:20:03 am »
Quote
it doesn't work

???
Please give more details. I don't even know what you're trying to do with this piece of code.
Laurent Gomila - SFML developer

Ashenwraith

  • Sr. Member
  • ****
  • Posts: 270
    • View Profile
[Solved]100% pixel perfect sf::View size?
« Reply #2 on: June 25, 2010, 11:26:12 am »
I'm trying to get all of the sprites to be at their 100% default size but there seems to be ratio/size problems.

Code: [Select]

    sf::Vector2f Center(1000,1000);
    sf::Vector2f HalfSize(App.GetWidth()*.5f,App.GetHeight()*.5f); //516/387
    sf::View View(Center,HalfSize);


I'm guessing there is a 100% default setting?

I saw GetDefaultView() but it doesn't seem to do it

I also tried this and it doesn't work either:
Code: [Select]

    sf::View View(sf::FloatRect(0.f,0.f,App.GetWidth(),App.GetHeight()));

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
[Solved]100% pixel perfect sf::View size?
« Reply #3 on: June 25, 2010, 11:44:03 am »
I've done that many times, it's supposed to work.

Can you provide a minimal and complete example that reproduces this problem?
Laurent Gomila - SFML developer

Ashenwraith

  • Sr. Member
  • ****
  • Posts: 270
    • View Profile
[Solved]100% pixel perfect sf::View size?
« Reply #4 on: June 25, 2010, 12:14:45 pm »
Nevermind, it works perfect.

I was using the magic wand to test from screenshots and I forgot to turn anti-alias off even though the dotted selection looked right.

That's strange. I think photoshop CS 5 maybe does that differently. I don't remember it antialiasing solid colors when tolerance was 1 in previous versions.

Actually looking at it again this appears to be a bug in CS 5. When you paste the selection it has no anti-aliasing but it adds extra space to it. Wow, Adobe is really slipping--this might screw up a lot of people's older scripts.