Hi all
In CEGUI Layout Editor, there is the possibility to add staticText widgets, but how to access them from the code ?
the class CEGUI::StaticText does not exist ...
Maybe I didn't choose correctly the widget I need. I need a widget only displaying a text, that I could could modify from c++ code. What is the best way ?
[solved] how to access a StaticText ?
Moderators: CEGUI MVP, CEGUI Team
[solved] how to access a StaticText ?
Last edited by khayyam on Wed Mar 21, 2007 13:50, edited 1 time in total.
- Levia
- Quite a regular
- Posts: 83
- Joined: Mon May 22, 2006 18:25
- Location: Bergen op zoom, The Netherlands
- Contact:
To get it from C++ (for 0.4)
for 0.5 I think it is
Code: Select all
CEGUI::StaticText * myTextEntry = (CEGUI::StaticText*)CEGUI::WindowManager::getSingletonPtr()->getWindow("nameofthewindow");
for 0.5 I think it is
Code: Select all
CEGUI::Static * myTextEntry = (CEGUI::Static*)CEGUI::WindowManager::getSingletonPtr()->getWindow("nameofthewindow");
Levia wrote:for 0.5 I think it isCode: Select all
CEGUI::Static * myTextEntry = (CEGUI::Static*)CEGUI::WindowManager::getSingletonPtr()->getWindow("nameofthewindow");
CEGUI::Static does not exist ...
Widget Galore shows how to use most types of Cegui windows (which I call widgets). The short answer is to use DefaultWindow.
Then there's this post:
Then there's this post:
Rackle wrote:Upgraded to v0.5.0.
The v0.4 StaticText codeCode: Select all
StaticText* staticText = static_cast<StaticText*>(winMgr.getWindow((utf8*) "StaticText"));
staticText->setText("Red StaticText");
staticText->setTextColours( colour(1.0f, 0.0f, 0.0f, 1.0f) ); // Red text
staticText->setFormatting(StaticText::HorzCentred, StaticText::VertCentred); // Center the text
was upgraded to v0.5.0 like thisCode: Select all
DefaultWindow* staticText = static_cast<DefaultWindow*>(winMgr.getWindow("StaticText"));
staticText->setText("Red Static Text");
staticText->setProperty("TextColours", "tl:FFFF0000 tr:FFFF0000 bl:FFFF0000 br:FFFF0000");
staticText->setProperty("VertFormatting", "VertCentred");
staticText->setProperty("HorzFormatting", "HorzCentred");
The v0.4 StaticImage codeCode: Select all
ImagesetManager::getSingleton().createImagesetFromImageFile("ImageForStaticImage", "../datafiles/imagesets/GPN-2000-001437.tga");
StaticImage* staticImage = static_cast<StaticImage*>(winMgr.getWindow("StaticImage"));
staticImage->setImage("ImageForStaticImage", "full_image");
was upgraded to v0.5.0 like thisCode: Select all
ImagesetManager::getSingleton().createImagesetFromImageFile("ImageForStaticImage", "GPN-2000-001437.tga");
DefaultWindow* staticImage = static_cast<DefaultWindow*>(winMgr.getWindow("StaticImage"));
staticImage->setProperty("Image", "set:ImageForStaticImage image:full_image");
Who is online
Users browsing this forum: No registered users and 13 guests