Postado Ontem às 20:531 dia atrás pessoal estou com seguinte problema, na minha tela de seleção quando vou criar um novo personagem ele me aparece assimTela de criação de chara questão é que em 800*600 ele aprece certinho centralizado, aonde eu poderia arrumar isso para ele renderizar conforme a resolução da tela ?
Postado Ontem às 22:291 dia atrás Solução HoLogin.cpp, procura por: dsDrawTexImage( FaceBoxBigImage[ 0 ] int addX = smScreenWidth / 2 - 800 / 2; if( (smConfig.ScreenSize.x 800 && smConfig.ScreenSize.y 600 ) || ( smConfig.ScreenSize.x 1024 && smConfig.ScreenSize.y 768 ) || ( smConfig.ScreenSize.x 1280 && smConfig.ScreenSize.y 960 ) || ( smConfig.ScreenSize.x 1400 && smConfig.ScreenSize.y 1050 ) ) { int newPosX = int( ( ( float )smScreenWidth*272.f ) / 800.f ); int newPosY = int( ( ( float )smScreenHeight*82.f ) / 600.f ); int newWidth = int( ( ( float )smScreenWidth*256.f ) / 800.f ); int newHeight = int( ( ( float )smScreenHeight*128.f ) / 600.f ); dsDrawTexImage( FaceBoxBigImage[ 0 ], newPosX, newPosY, newWidth, newWidth, 255 ); dsDrawTexImage( FaceBoxBigImage[ 1 ], newPosX, newPosY + newWidth, newWidth, newHeight, 255 ); } else { int newPosX = int( ( ( float )smScreenWidth*272.f ) / 724.f ); int newPosY = int( ( ( float )smScreenHeight*82.f ) / 600.f ); int newWidth = int( ( ( float )smScreenWidth*256.f ) / 1028.f ); int newHeight = int( ( ( float )smScreenHeight*128.f ) / 772.f ); dsDrawTexImage( FaceBoxBigImage[ 0 ], newPosX, newPosY + 10, newWidth, newWidth, 255 ); dsDrawTexImage( FaceBoxBigImage[ 1 ], newPosX, newPosY + newWidth + 10, newWidth, newHeight, 255 ); } int addY = smScreenHeight / 2 - 600 / 2; DrawEachPlayer( 0.5f, 0.4f, 2 ); Editado ontem às 22:421 dia atrás por ViGo
Postado 23 horas atrás23 horas atrás Autor Obrigado meu mano @ViGo segue um adicional para quem usa 4:3 e 16:9 Cod Hologin.cppint addX = smScreenWidth / 2 - 800 / 2;if ((smConfig.ScreenSize.x 800 && smConfig.ScreenSize.y 600) ||(smConfig.ScreenSize.x 1024 && smConfig.ScreenSize.y 768) ||(smConfig.ScreenSize.x 1280 && smConfig.ScreenSize.y 960) ||(smConfig.ScreenSize.x 1400 && smConfig.ScreenSize.y 1050)){int newPosX = int(((float)smScreenWidth * 272.f) / 800.f);int newPosY = int(((float)smScreenHeight * 82.f) / 600.f);int newWidth = int(((float)smScreenWidth * 256.f) / 800.f);int newHeight = int(((float)smScreenHeight * 128.f) / 600.f);dsDrawTexImage(FaceBoxBigImage[0], newPosX, newPosY, newWidth, newWidth, 255);dsDrawTexImage(FaceBoxBigImage[1], newPosX, newPosY + newWidth, newWidth, newHeight, 255);}else{int newPosX = int(((float)smScreenWidth * 272.f) / 724.f);int newPosY = int(((float)smScreenHeight * 82.f) / 600.f);int newWidth = int(((float)smScreenWidth * 256.f) / 1028.f);int newHeight = int(((float)smScreenHeight * 128.f) / 772.f);dsDrawTexImage(FaceBoxBigImage[0], newPosX, newPosY + 10, newWidth, newWidth, 255);dsDrawTexImage(FaceBoxBigImage[1], newPosX, newPosY + newWidth + 10, newWidth, newHeight, 255);}int addY = smScreenHeight / 2 - 600 / 2;outra coisa que me esqueci, para que fique alinhado ali aonde escreve o nome fica aqui:Cod#ifdef LANGUAGEVEITNAM int newTexPosX = int(((float)SETTINGSHANDLER->getWidth() * 358.f) / 800.f + 13);#else int newTexPosX = int(((float)SETTINGSHANDLER->getWidth() * 358.f) / 800.f);#endif int newTexPosY = int(((float)SETTINGSHANDLER->getHeight() * 398.f) / 600.f); dsTextLineOut(newTexPosX + 20, newTexPosY + 25, UserCharacterNewName, strlen(UserCharacterNewName));E TAMBÉM EM:#ifdef LANGUAGEVEITNAM int newTexPosX = int(((float)smScreenWidth * 356.f) / 800.f + 13);#else int newTexPosX = int(((float)SETTINGSHANDLER->getWidth() * 356.f) / 800.f);#endif int newTexPosY = int(((float)SETTINGSHANDLER->getHeight() * 397.f) / 600.f); //Ponteiro para escrever o nome do personagem dsTextLineOut(newTexPosX + start * 6 + 20, newTexPosY + 25, "|", 1); } i++; if (i > 12) i = 0; } return TRUE;(Estou utilizando arquivos da source elemental) Editado 22 horas atrás22 horas atrás por MeliodasBr detalhe
Postado 21 horas atrás21 horas atrás esse monte de cast em estilo C vai gerar um monte de warning. Veja sobre static_cast e derivados. Veja como fazer casting em c++.
pessoal estou com seguinte problema, na minha tela de seleção quando vou criar um novo personagem ele me aparece assim
Tela de criação de char
a questão é que em 800*600 ele aprece certinho centralizado, aonde eu poderia arrumar isso para ele renderizar conforme a resolução da tela ?