Jump to content

[Solved] Display part of text


Patrik
 Share

Recommended Posts

Hello

 

I was wondering if it's possible using the built in text function to somehow only render part of the text on the y-axis. (see picture)

 

 

text.jpg

 

How would you achieve this result?

Scale it? Render all text and erase the parts no wanted?

Link to comment
Share on other sites

  • 1 month later...

Ok, thanks for the tip.

 

 

I also found another way to do it also using the glScissor(x, y, width, height) command.

glScissor command

 

Then you can specify an area on the screen and stuff rendered outside that area will not be shown.

 

Do you have an example for using glScissor? I just can't get it working together with the coordinate system ...

 

Thanks!

Link to comment
Share on other sites

I don't have access to my computer with the code at the moment.

 

The problem may be that glScissors uses the bottom of the screen as it's 0 coordinate on the Y-axis and the drawing commands uses the top of the screen as 0 on Y-axis.

 

You can check if this is the case by by setting the glScissor to something like glScissor(10, 50, 20, 20 ) and then draw one rectangle that covers the whole screen. Then it should only render a 20x20 sized cube on the left side either at the top or bottom.

 

If it gets rendered at the bottom this is the case. Then you need to offset the glScissor(x, y, width, height) command's y parameter with the height of the screen resolution to get the wanted position.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...