i seem to have a problem with my IGUIStaticText.
This works:
gui::IGUIStaticText *text = guienv -> addStaticText( L"blagh!", rect<s32>( 10, 10, 200, 22 ), false );
These does not:
gui::IGUIStaticText *text = guienv -> addStaticText( L"blagh!", rect<s32>( 10, 20, 200, 22 ), false );
gui::IGUIStaticText *text = guienv -> addStaticText( L"blagh!", rect<s32>( 200, 10, 200, 22 ), false );
... i have the width set to 200 because i want to be able to change its text later
my window is 1024x768 windowed
is there a problem with it, or is there a limit to where you can display it?
IGUIStaticText coordinates problem.
-
[ds] Swift
- Posts: 20
- Joined: Sun Nov 14, 2004 1:57 am
- Location: Rochester, New York, USA
I don't know, if this is related to your problem, because you did not really specify what exactly is wrong with your static text, but in the code example above you declare the pointer text twice. You can remove the gui::IGUIStaticText * before the second pointer.
If this isn't your problem, maybe you can specify it a bit more, for example is it visible at all, is it at a wrong position, is it not compiling, or whatever...
If this isn't your problem, maybe you can specify it a bit more, for example is it visible at all, is it at a wrong position, is it not compiling, or whatever...
-
[ds] Swift
- Posts: 20
- Joined: Sun Nov 14, 2004 1:57 am
- Location: Rochester, New York, USA
-
[ds] Swift
- Posts: 20
- Joined: Sun Nov 14, 2004 1:57 am
- Location: Rochester, New York, USA
sorry it didn't make any sense.
i have the pointer declared once in my application.
i was just showing that my first declaration worked, and upon changing it to new values it didn't.
Maybe this will help more:
if i change the static text line to:
it wont display at all. im really confused. my window is large enough to display it but it won't 
i have the pointer declared once in my application.
i was just showing that my first declaration worked, and upon changing it to new values it didn't.
Maybe this will help more:
Code: Select all
int main() {
IrrlichtDevice *device = createDevice( EDT_SOFTWARE, dimension2d<s32>( 1024, 768), 128, false, false, false, 0 );
device->setWindowCaption( L"NaNoCrON software - Irrlicht Test" );
IVideoDriver* driver = device->getVideoDriver();
ISceneManager* smgr = device->getSceneManager();
IGUIEnvironment* guienv = device->getGUIEnvironment();
guienv->addStaticText( L"Hi", rect<int>( 10, 10, 200, 22 ), false );
while( device->run() ) {
driver->beginScene( true, true, SColor( 0, 200, 200, 200 ) );
smgr->drawAll();
guienv->drawAll();
driver->endScene();
}
device->drop();
return 0;
}
Code: Select all
guienv->addStaticText( L"Hi", rect<int>( 400, 400, 200, 22 ), false );
Code: Select all
guienv->addStaticText( L"Hi", rect<int>( 200, 22, 400, 400 ), false ); Code: Select all
x1/y1 x2
y2
-
[ds] Swift
- Posts: 20
- Joined: Sun Nov 14, 2004 1:57 am
- Location: Rochester, New York, USA
O-M-G! am i a total moron
. lol. thanx, that helped me..
i just came off of this engine that my buddies and i had written. its pretty outdated now, thats y i moved to irrlicht. and in that engine we made our rectangle function:
and thats what i was doing instead of ( x1, y1, x2, y2 );
moron!
i just came off of this engine that my buddies and i had written. its pretty outdated now, thats y i moved to irrlicht. and in that engine we made our rectangle function:
Code: Select all
rectangle( float xPos, float yPos, float length, float height );
moron!