Sign in to follow this  
wallytsx

Gui Textbox

Recommended Posts

Hello!!, im trying to make a textbox control with SFML library, but i dont understand how to properly render the text, and the relation with de caret position and so on...
I know that i can use glScissor to clip the text area....
I appreciate someone explain how it works!
Thanks

Share this post


Link to post
Share on other sites
For the font, there should be a function to tell you the height of the font (usually there is one that tells you the height of an entire text). It depends on the rendering library you're using for fonts.

To clip an area I personally use glViewport/glOrtho and not glScissor.

Share this post


Link to post
Share on other sites
[quote name='owl' timestamp='1305573861' post='4811583']
For the font, there should be a function to tell you the height of the font (usually there is one that tells you the height of an entire text). It depends on the rendering library you're using for fonts.

To clip an area I personally use glViewport/glOrtho and not glScissor.
[/quote]

Im using SFML 1.6.
Suppose i can clip the textbox, then how do i draw correctly the text.
Logicaly the basic managment of the textbox is easy, i cant understand how to properly draw the text.
Thanks

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this