[Admin] tierrilopes Posted August 11, 2017 at 01:04 AM Share Posted August 11, 2017 at 01:04 AM Serve para que quando abram o jogo em modo janela, este apareça centrado magicamente Ir até ao ficheiro UserInterface/PythonApplication.cpp Em bool CPythonApplication::Create(PyObject * poSelf, const char * c_szName, int width, int height, int Windowed) Procurar por: int windowWidth = (rc.right - rc.left); int windowHeight = (rc.bottom - rc.top); CMSApplication::SetPosition(GetScreenWidth() - windowWidth, GetScreenHeight() - 60 - windowHeight); Modificar para: int windowWidth = (rc.right - rc.left); int windowHeight = (rc.bottom - rc.top); windowWidth = (GetScreenWidth() - windowWidth); windowWidth = (windowWidth / 2); windowWidth = windowWidth - 8; windowHeight = (GetScreenHeight() - windowHeight); windowHeight = (windowHeight / 2); windowHeight = (windowHeight - 61); CMSApplication::SetPosition(windowWidth, windowHeight); //Centrado + esconder barra de programa na parte superior do ecrã //CMSWindow::SetCenterPosition(); //Apenas centrado Cumprimentos, Tierri Lopes Link to comment Share on other sites More sharing options...
Nukayool Posted August 11, 2017 at 02:02 PM Share Posted August 11, 2017 at 02:02 PM Boas, Eu apliquei a alteração e mesmo assim ao abrir a janela o cliente fica no canto. Link to comment Share on other sites More sharing options...
[Admin] tierrilopes Posted August 11, 2017 at 04:26 PM Author Share Posted August 11, 2017 at 04:26 PM Possivelmente o teu binário não estava a fazer o calculo todo antes de determinar a posição. Mudei o tópico inicial e meti o calculo por etapas, para que o binário faça tudo exatamente por essa ordem. Link to comment Share on other sites More sharing options...
Marco Posted August 17, 2017 at 12:23 PM Share Posted August 17, 2017 at 12:23 PM Eu também não consegui Link to comment Share on other sites More sharing options...
Nukayool Posted August 18, 2017 at 12:24 AM Share Posted August 18, 2017 at 12:24 AM Só funciona no modo de resolução 800x600 Link to comment Share on other sites More sharing options...
juniorsilva Posted August 18, 2017 at 01:14 AM Share Posted August 18, 2017 at 01:14 AM 12 horas atrás, L2P disse: Eu também não consegui Resolução de tela 1920x1080 widescreen. Link to comment Share on other sites More sharing options...
[Admin] tierrilopes Posted August 18, 2017 at 11:22 AM Author Share Posted August 18, 2017 at 11:22 AM Meti em todas as resoluções ate 1920 1080, funciona sem problemas aqui Link to comment Share on other sites More sharing options...
noobexp Posted March 7, 2019 at 12:18 PM Share Posted March 7, 2019 at 12:18 PM Honestamente isso não funciona para mim .. A janela continua a abrir sempre no canto esquerdo Link to comment Share on other sites More sharing options...
[Admin] tierrilopes Posted March 7, 2019 at 01:29 PM Author Share Posted March 7, 2019 at 01:29 PM 1 hour ago, noobexp said: Honestamente isso não funciona para mim .. A janela continua a abrir sempre no canto esquerdo No tutorial, nesta parte: CMSApplication::SetPosition (windowWidth, windowHeight); //Centrado + esconder barra de programa //CMSWindow::SetCenterPosition(); //Apenas centrado Deixa assim: //CMSApplication::SetPosition (windowWidth, windowHeight); //Centrado + esconder barra de programa CMSWindow::SetCenterPosition(); //Apenas centrado Na mesma função do tutorial (esta abaixo) CPythonApplication::Create Procura por: else { m_isWindowed = false; SetPosition (0, 0); } Edita para: else { m_isWindowed = false; //SetPosition (0, 0); CMSWindow::SetCenterPosition(); } Ainda na mesma função, procura por: CGrannyMaterial::CreateSphereMap (0, "d:/ymir work/special/spheremap.jpg"); CGrannyMaterial::CreateSphereMap (1, "d:/ymir work/special/spheremap01.jpg"); return true; E edita desta maneira (ignora se já estiver): CGrannyMaterial::CreateSphereMap (0, "d:/ymir work/special/spheremap.jpg"); CGrannyMaterial::CreateSphereMap (1, "d:/ymir work/special/spheremap01.jpg"); CMSWindow::SetCenterPosition(); return true; Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now