simple menu different behaviour

rekotc

13-07-2010 15:08:05

i've created a simple menu and it works perfectly on my pc, while on my friend's computer the menu is "strange", it's easier if you look at the pics :) the application code is exactly the same so i have no ideas for solving this problem, thanks for you help

rekotc

13-07-2010 15:12:28

it's like "compressed" in some way along the Y axis, the events work but if i click on "ESCI A WINDOWS" the system selects the wrong event (the one made for "CREDITI")

kungfoomasta

13-07-2010 18:07:30

Its weird because it looks like the window is bigger in the second screenshot. The window shouldn't be stretching even if the Sheet size changes. Can you try running both on the same resolution Render Window to see if they look the same? (also, are they both using the same render system, ie DirectX or OpenGL?)

rekotc

13-07-2010 18:45:16

Maybe we found something, i made the function so that the window size always depends on the render window :

int widthGUI = mWindow->getWidth()/4;
int heightGUI = mWindow->getHeight()/2;


i did it because i thought it could be a good idea to keep the menu always centered, if i change it with some constant values sometimes it works sometimes it doesnt and i cant find the reason..

rekotc

13-07-2010 18:45:57

anyway using the same renderWindow and renderer dont solve the problem

kungfoomasta

14-07-2010 18:42:09

The window size shouldn't affect the rendering. To me it looks like I'm clipping the text at the top and bottom, probably an off by one error. (clipping to short by 1 pixel)

If you tried a bigger font I'd be interested in seeing if the same result occurs. I think this issue is a rounding problem and just happened to show up.

rekotc

14-07-2010 21:59:09

mm actually im using the same font i found in the tutorials, micross.12, my friend also tried with different sizes 10 18 20 24 and still the same problem, still the same also when clicking on the buttons, but i guess it still depens on this weird stretching

kungfoomasta

14-07-2010 22:18:51

What are you doing with the variables you derived?


int widthGUI = mWindow->getWidth()/4;
int heightGUI = mWindow->getHeight()/2;


Sorry for so many issues with the lib. Normally I would repro and put in a fix quickly, but I think I can knock out the next generation of QuickGUI in 2 weeks or so; I've been spending most nights developing the new stuff.

rekotc

14-07-2010 22:36:51

i use those variables for defining the window dimension (the window in the pic)

wd->widget_dimensions.size = QuickGUI::Size(widthGUI,heightGUI);

dont be sorry :) im not even sure it's related with your lib, im still learning to use it and im definitely not an expert, thanks to you for answering every time!

kungfoomasta

14-07-2010 23:34:39

I feel bad seeing somebody have these issues when using my lib. Hopefully I can provide a better alternative pretty quickly. Although there is some setup involved with this next version. (There will be tutorials.. basically the rendering is outsourced and QuickGUI is not married to Ogre, although we're all using Ogre under the hood :wink: )

The first snippet of code you use the window to get the width and height, but in the second snippet you're setting the window's width and height? Or are there 2 different windows involved here?

rekotc

15-07-2010 11:08:42

maybe my code is a mess :D...with "window" i mean a QuickGUI::Window, for setting this window i get the size of the Ogre::RenderWindow* mWindow, so first of all i get the mWindow width and height, then i use them for setting a windowDesc wd for the window mainMenu, i hope now it's more clear


int widthGUI = mWindow->getWidth()/4;
int heightGUI = mWindow->getHeight()/2;

//faccio lo stesso per la posizione della finestra, le coordinate sono riferite all'angolo in alto a destra della finestra
int positionX = (mWindow->getWidth()-widthGUI)/2;
int positionY = 100;

//creo il descriptor della finestra che contiene i pulsanti del menu
QuickGUI::WindowDesc* wd = QuickGUI::DescManager::getSingleton().getDefaultWindowDesc();
wd->resetToDefault();
//altrimenti è trascinabile in giro :D
wd->widget_dragable = false;
//visibile
wd->widget_visible = true;
//non ridimensionabile
wd->widget_resizeFromBottom = false;
wd->widget_resizeFromLeft = false;
wd->widget_resizeFromRight = false;
wd->widget_resizeFromTop = false;
wd->widget_name = "finestrella del cazzo";
wd->widget_dimensions.size = QuickGUI::Size(widthGUI,heightGUI);
wd->widget_dimensions.position = QuickGUI::Point(positionX,positionY);
//questo schifo è necessario per passargli il testo da scrivere sul titolo della finestra, in generale questo
//metodo serve ogni volta che vuoi scrivere testo su un oggetto QuickGUI, segments l'avevo definito in gameGUIListener.h
wd->textDesc.segments.push_back(QuickGUI::TextSegment("halflife10",QuickGUI::ColourValue::Black,"Menu Principale"));
//modo standard, creo il menu attaccandolo allo sheet con i parametri del descriptor
mainMenu = mySheet->createWindow(wd);

//setto il menu corrente come il menu principale
currentMenu=mainMenu;

rekotc

15-07-2010 21:23:17

good news, it works on my friends' laptop, so i guess it could be some kind of incompatibility with specific configurations