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

Author Topic: [SFML 2.0] sf::View TextBox  (Read 2678 times)

0 Members and 1 Guest are viewing this topic.

deadmau5

  • Newbie
  • *
  • Posts: 24
    • View Profile
[SFML 2.0] sf::View TextBox
« on: August 08, 2013, 10:16:16 pm »
Hey,

Wanted to try and create a TextBox using a texture font (glyphs).
I want to try this without using any third party library.

The problem I'm having:
Scrolling tiles with a sf::View is working well if it covers the entire window (800x600).
Creating a TextBox would practically be the same, however I don't want to use the entire window with the sf::View since I only need a small part for the TextBox (200x20) showing only the characters which should be visible. (for example, only the text that fits in the TextBox's width should be shown)

So my question is:
Is it possible to use a sf::View without making the fonts HUGE or using the entire window? Like a sub-view.
I'm guessing it has to do with the viewport like I have seen in some tutorials but fail to see how it would be related to my problem using scales..

Any ideas / tips on how to approach this would be appreciated.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: [SFML 2.0] sf::View TextBox
« Reply #1 on: August 08, 2013, 10:31:42 pm »
Indeed, setting the viewport to the area of your text box should solve your problem.
Laurent Gomila - SFML developer

deadmau5

  • Newbie
  • *
  • Posts: 24
    • View Profile
Re: [SFML 2.0] sf::View TextBox
« Reply #2 on: August 08, 2013, 11:04:30 pm »
Indeed, setting the viewport to the area of your text box should solve your problem.
Nevermind got it.
« Last Edit: August 09, 2013, 01:32:20 am by deadmau5 »

 

anything