Page 1 of 1


Posted: Sun Jan 02, 2005 4:51 am
by woody
Does anyone know how to rotate a Ogre Gui Element? I know it can be done but can't find any rotate function in OgreMain.

Also, If I wanted to do a split screen what would I need to do. I know I would need 2 cameras, and thus 2 viewports but how would I do this.


Posted: Mon Jan 03, 2005 2:17 am
by Mdobele
The way I rotated my overlay for a speedo pin was to have the pin as a seperate overlay completely and rotate that using its rotate function.

This worked in 0.14 but i havnt tried it in 0.15

Code: Select all

// 0.14 version
SpeedoPinOverlay->setRotate( 45.0 );  // By Degrees

Code: Select all

// 0.15 Might have to simply change it to 
SpeedoPinOverlay->setRotate( Degree(45.0) );  // By Degrees
Now that will rotate it around the top left corner of your overlay so dont forget to put the centre of the pin in that corner.

Also there is another step. Here is an example of my Overlay

Code: Select all

container Panel(SpeedoDial) : SS/Templates/BasicBorderPanel
			left 0.5 
			top 0.5
			width 0.15
			height 0.15

			material Interface_HUD_SpeedoPin
Note i had to place it in the centre of the screen and then in code offset it to where i wanted it to be so that it worked correctly. Otherwise it would rotate around the centre of the screen.

Code: Select all

// Offset it in code so Pin is now placed in lower right hand corner

Now you can roatate it and it will hopefully all be good.

Hope that helps.

Posted: Mon Jan 03, 2005 3:38 am
by woody
Thanks. I was always trying to rotate the single part of the overlay not the entire overlay. That helps heaps. Cheers.[/i]

Posted: Wed Jan 05, 2005 1:40 am
by woody
Do you know why when you rotate a overlay that it stretches and squashes? It seems to do it to me when ever I rotate it at all.

Posted: Wed Jan 12, 2005 9:45 am
by yuyeyue3841
I have the same question!
I beg your help!
Thank you !

Posted: Thu Jan 13, 2005 7:47 am
by Vanish
Just implementing a tachometer for my Ogrewton::Vehicle demo and I noticed the same thing. Looks like it has something to do with the aspect ratio of the screen.

We knew the gui part was buggy (and is being removed) but the overlay stuff is in need of some loving too! I think I'll post some requests lol.

Posted: Thu Jan 13, 2005 2:20 pm
by sinbad
It is because the overlay itself is in relative coordinates and the screen is not square.

The overlay system is not going to get any enhancements before 1.0.0, if you want to do something more inventive with 2D geometry you can always just create a Renderable subclass to do it - Rectangle2D is an example of such. You can do anything at all that you need with Renderable.