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.
Thanks
Problems
-
- Halfling
- Posts: 55
- Joined: Mon Jun 07, 2004 11:01 am
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
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
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.
Now you can roatate it and it will hopefully all be good.
Hope that helps.
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
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
}
Code: Select all
// Offset it in code so Pin is now placed in lower right hand corner
SpeedoPinOverlay->scroll(0.8,-0.8);
Hope that helps.
PrimedGames
www.PrimedGames.com
Email Me At
Mdobele( AT )primedgames.com
// Replace AT with @ of course
www.PrimedGames.com
Email Me At
Mdobele( AT )primedgames.com
// Replace AT with @ of course
-
- Gnoblar
- Posts: 6
- Joined: Sun Nov 14, 2004 11:05 am
-
- Gnoblar
- Posts: 6
- Joined: Sun Nov 14, 2004 11:05 am
-
- Gnoblar
- Posts: 1
- Joined: Wed Jan 12, 2005 9:44 am
-
- Gnoblar
- Posts: 16
- Joined: Thu Dec 23, 2004 6:18 pm
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.
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.
-
- OGRE Retired Team Member
- Posts: 19269
- Joined: Sun Oct 06, 2002 11:19 pm
- Location: Guernsey, Channel Islands
- x 66
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.
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.