About Store Forum Documentation Contact



Post Reply 
difficulties with GUI text objects...
Author Message
jordicat Offline
Member

Post: #1
difficulties with GUI text objects...
Hi, I am working with GUI, especially with objects type Text. The idea is that I want to put text with many lines of any size inside an object type Window, which can be of any size and aspect. I understand the coordinates of Window, but with Text is different...

This is my code:

Code:
char str[10000];
int r;
Font *font;
File file;

file.reset();
r=file.readStdTry("../textos/Fenomen.txt");
memset(str,0,sizeof(str)); file.get(str, file.size());
IGF.wnd.create(Rect(-0.4,-0.5,  0.0,0.8),"Window with menu");

font=Fonts("../Fonts/Arial.font");
static TextDS text_ds;
IGF.wnd.rect.w(),0),"Text");
IGF.text.create(Rect(IGF.wnd.crect.w()*0.01f,
                                -IGF.wnd.crect.h()*.99,  
                IGF.wnd.crect.w()*0.99f,    
                                -IGF.wnd.crect.h()*.01),
                         "Text");
IGF.text.set(str);
IGF.text.auto_line=AUTO_LINE_CHAR;
    text_ds.align.set(IGF.text.rect.w(), -IGF.text.rect.h()*.95);
    text_ds.color=Vec(.6,.6,.99);
    text_ds.font=font;
    text_ds.scale=Vec2(.05);

IGF.text.tds=&text_ds;
IGF.wnd += IGF.text;
Gui += IGF.wnd;
   
but I cound't find the formula/way to put the text exactly where I want inside de window and I have tried it many hours. Perhaps I am making some mistakes? I need to know the general way to write text...
How I can put a text (of 100 lines for example) inside a object type Window like the Windows XP Notepad. It is posible?

Thanks!.
02-12-2010 07:17 PM
Find all posts by this user Quote this message in a reply
jordicat Offline
Member

Post: #2
RE: difficulties with GUI text objects...
Please I need help about the message I posted.
02-14-2010 11:38 AM
Find all posts by this user Quote this message in a reply
Chris Offline
Member

Post: #3
RE: difficulties with GUI text objects...
Have you had a look at the tutorial at Gui > 16 Chatbox? There you can have long messages, and also place text within Rects.
02-14-2010 11:54 AM
Find all posts by this user Quote this message in a reply
jordicat Offline
Member

Post: #4
RE: difficulties with GUI text objects...
Thanks Chris, before I didn't look this tutorial. I will study the code and after I will try to do it in a similar way.
02-14-2010 11:26 PM
Find all posts by this user Quote this message in a reply
Post Reply