Added shadow, working on UI adapting
This commit is contained in:
1 parent
f61a12f874
commit
c991b5dbc1
10 files changed
+385817
-37
No files matched your search
+1
-1
@@ -653,7 +653,7 @@ namespace ZL
|
||||
Environment::width = event.window.data1;
|
||||
Environment::height = event.window.data2;
|
||||
Environment::computeProjectionDimensions();
|
||||
//menuManager.uiManager.updateAllLayouts();
|
||||
menuManager.uiManager.updateAllLayouts();
|
||||
std::cout << "Window resized: " << Environment::width << "x" << Environment::height << std::endl;
|
||||
|
||||
//space.clearTextRendererCache();
|
||||
|
||||
+14
-2
@@ -2161,16 +2161,28 @@ namespace ZL {
|
||||
node->name = nodeName;
|
||||
node->width = bubble->computeWidth();
|
||||
node->height = bubble->computeHeight();
|
||||
node->localX = 430.0f;
|
||||
|
||||
if (incoming) {
|
||||
node->localX = -node->width * 0.5+110 - (UiChatBubble::MAX_WIDTH - node->width);// +(425.f - node->width);
|
||||
}
|
||||
else
|
||||
{
|
||||
node->localX = node->width * 0.5-110 - (UiChatBubble::MAX_WIDTH - node->width);// -(425.f - node->width);
|
||||
}
|
||||
//430
|
||||
//1280
|
||||
|
||||
node->localY = 0.0f;
|
||||
node->visible = true;
|
||||
node->chatBubble = bubble;
|
||||
|
||||
node->layoutSettings.hGravity = HorizontalGravity::Center;
|
||||
/*
|
||||
if (incoming) {
|
||||
node->layoutSettings.hGravity = HorizontalGravity::Left;
|
||||
} else {
|
||||
node->layoutSettings.hGravity = HorizontalGravity::Right;
|
||||
}
|
||||
}*/
|
||||
// Bottom gravity means localY is used as-is for screenRect.y (no parentH transform).
|
||||
// The original static chat nodes all had "vertical_gravity": "bottom" for the same reason.
|
||||
node->layoutSettings.vGravity = VerticalGravity::Bottom;
|
||||
|
||||
+11
-1
@@ -259,7 +259,7 @@ int main(int argc, char *argv[]) {
|
||||
}*/
|
||||
const Uint32 windowFlags = SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN | SDL_WINDOW_FULLSCREEN_DESKTOP;
|
||||
#else
|
||||
const Uint32 windowFlags = SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN;
|
||||
const Uint32 windowFlags = SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN | SDL_WINDOW_ALLOW_HIGHDPI;
|
||||
#endif
|
||||
|
||||
ZL::Environment::window = SDL_CreateWindow(
|
||||
@@ -272,6 +272,16 @@ int main(int argc, char *argv[]) {
|
||||
SDL_GLContext ctx = SDL_GL_CreateContext(ZL::Environment::window);
|
||||
SDL_GL_MakeCurrent(ZL::Environment::window, ctx);
|
||||
|
||||
// On HiDPI displays the drawable (physical) size is larger than the
|
||||
// logical window size. Use the drawable size so the GL framebuffer
|
||||
// covers every physical pixel and the image stays sharp.
|
||||
{
|
||||
int drawW, drawH;
|
||||
SDL_GL_GetDrawableSize(ZL::Environment::window, &drawW, &drawH);
|
||||
ZL::Environment::width = drawW;
|
||||
ZL::Environment::height = drawH;
|
||||
}
|
||||
|
||||
game.setup();
|
||||
|
||||
while (!game.shouldExit()) {
|
||||
|
||||
Reference in new issue
Block a user