All I want to do is draw "Hello World" on the screen purely from code. No layouts or XML files. There shouldn't be a background or scroll bars. I just want "Hello World" by itself. Using the default font, color, etc. Use any coordinates you wish.
Can CEGUI do this? If so, can someone please post the code?
How to draw "Hello World"?
Moderators: CEGUI MVP, CEGUI Team
Have a look at Sample_FirstWindow; it creates a frame window.
Line 128 of Sample_FirstWindow.cpp contains:
Remove that line and those until the end of that function. You can then use this (slightly modified) snippet from Sample_Demo7.cpp to create the text:
I'm assuming you are still using Cegui v0.4. If not then have a look at Widget Galore to convert the StaticText of v0.4 to that of v0.5.
Line 128 of Sample_FirstWindow.cpp contains:
Code: Select all
FrameWindow* wnd = (FrameWindow*)winMgr.createWindow("TaharezLook/FrameWindow", "Demo Window");
Remove that line and those until the end of that function. You can then use this (slightly modified) snippet from Sample_Demo7.cpp to create the text:
Code: Select all
// create a static text with some information in.
StaticText* stxt = static_cast<StaticText*>(winMgr.createWindow("TaharezLook/StaticText", "Demo7/Window1/Text1"));
root->addChildWindow(stxt);
stxt->setMaximumSize(Size(1.0f, 1.0f));
stxt->setPosition(Point(0.5f, 0.1f));
stxt->setSize(Size(0.45f, 0.5f));
stxt->setText("Hello world.");
stxt->setFrameEnabled(false);
stxt->setBackgroundEnabled(false);
stxt->setHorizontalFormatting(StaticText::WordWrapCentred);
I'm assuming you are still using Cegui v0.4. If not then have a look at Widget Galore to convert the StaticText of v0.4 to that of v0.5.
-
- Just popping in
- Posts: 9
- Joined: Fri Jul 28, 2006 22:00
- Location: Perú
In this post you will find some code:
[url]
http://www.cegui.org.uk/phpBB2/viewtopic.php?t=1408
[/url]
[url]
http://www.cegui.org.uk/phpBB2/viewtopic.php?t=1408
[/url]
Who is online
Users browsing this forum: No registered users and 23 guests