Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
Trusted Contributor
Posts: 231
Registered: ‎11-19-2010
My Device: Z10, Playbook

'text box' using opengl es 1.1?

I'm using opengl ES 1.1, which means everything on the screen is just points,lines and triangles.

 

Is there a simple way to have a regular scrolling type text box for swipe-down app info like instructions etc? The regular screen data does not have to display while viewing the instructions.

Is the only option to use bbutil_render_text and manage the text like any other drawn object?

 

This is currently for playbook NDK 2.1

 

Developer
Posts: 120
Registered: ‎03-13-2012
My Device: Playbook, Dev Alpha C, Q10, Z10, Z30

Re: 'text box' using opengl es 1.1?

I don't use opengl es 1.1, just 'C'.

 

Have you tried using a dialog box?  They come in several sizes and if you have more text than can fit in the size chosen, the user can scroll the text to see the rest.  A single 'OK' button would be all you need for when the user is finished.

 

The dialog sample would be a good place to start.  It not only has a dialog box but it also gets the dialog box by swiping down.

Trusted Contributor
Posts: 231
Registered: ‎11-19-2010
My Device: Z10, Playbook

Re: 'text box' using opengl es 1.1?

Thanks.

I do make use of a dialog already, with a very brief message (maybe 5 words).

 

Is there anything special to be done to create a dialog with lets say a page or two of text?

 

Do you just create a string containing the text and use it as the argument when the dialog is created?

How do you handle line breaks or does the dialog recognize "/n" in the string?

Developer
Posts: 120
Registered: ‎03-13-2012
My Device: Playbook, Dev Alpha C, Q10, Z10, Z30

Re: 'text box' using opengl es 1.1?

Nothing special.  Just keep writing.

 

Yep, just create a string.

 

"\n" and "\n\n" are very helpful.

 

I don't think the html version works (where you can bold some words etc.).  I've tried.  If you can make it work with html, please clue me in.

 

You can also break it up by using buttons.  Say you have a long list of instuctions for 2 different parts of your app.  You could create 3 buttons, "OK", "Part 1", and "Part 2".   "OK" takes you back to the app and destroys the dialog.  "Part 1" destroys the dialog, then creates and shows another dialog with the instructions for Part 1.  Etc.

 

I've found dialogs very useful when used in a creative way to help get around the lack of UI in native without having to use third party libs.