Problems

A place for users of OGRE to discuss ideas and experiences of utilitising OGRE in their games / demos / applications.
Post Reply
woody
Gnoblar
Posts: 6
Joined: Sun Nov 14, 2004 11:05 am

Problems

Post by woody » Sun Jan 02, 2005 4:51 am

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
0 x
Woody

Mdobele
Halfling
Posts: 55
Joined: Mon Jun 07, 2004 11:01 am
Contact:

Post by Mdobele » Mon Jan 03, 2005 2:17 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

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

SpeedoPinOverlay->scroll(0.8,-0.8);
Now you can roatate it and it will hopefully all be good.

Hope that helps.
0 x
PrimedGames
www.PrimedGames.com

Email Me At
Mdobele( AT )primedgames.com
// Replace AT with @ of course

woody
Gnoblar
Posts: 6
Joined: Sun Nov 14, 2004 11:05 am

Post by woody » Mon Jan 03, 2005 3:38 am

Thanks. I was always trying to rotate the single part of the overlay not the entire overlay. That helps heaps. Cheers.[/i]
0 x
Woody

woody
Gnoblar
Posts: 6
Joined: Sun Nov 14, 2004 11:05 am

Post by woody » Wed Jan 05, 2005 1:40 am

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.
0 x
Woody

yuyeyue3841
Gnoblar
Posts: 1
Joined: Wed Jan 12, 2005 9:44 am

Post by yuyeyue3841 » Wed Jan 12, 2005 9:45 am

I have the same question!
I beg your help!
Thank you !
0 x

Vanish
Gnoblar
Posts: 16
Joined: Thu Dec 23, 2004 6:18 pm
Contact:

Post by Vanish » Thu Jan 13, 2005 7:47 am

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.
0 x

User avatar
sinbad
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 19265
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
x 2
Contact:

Post by sinbad » Thu Jan 13, 2005 2:20 pm

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.
0 x

Post Reply