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

Author Topic: How to draw to specific area of the window?  (Read 1136 times)

0 Members and 1 Guest are viewing this topic.

wixy0

  • Newbie
  • *
  • Posts: 4
    • View Profile
How to draw to specific area of the window?
« on: March 15, 2021, 04:52:26 pm »
I want to draw to very specific area of the window (starting from (250, 20) to right lower corner of the window, window also can be resized). I know I have to use viewport on a window sized view, but how to calculate its FloatRect? Viewport will be set to the black rectangle area and view will be moved by mouse so I can see whole loaded texture when it is bigger than window. I aiming for something like TileSet Editor from Godot engine.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11034
    • View Profile
    • development blog
    • Email
Re: How to draw to specific area of the window?
« Reply #1 on: March 20, 2021, 10:41:49 am »
Did you read the tutorial(s) on sf::View?

- Official
- Wiki
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

 

anything