Change default menu logo
This commit is contained in:
parent
6be169679b
commit
33b980dacb
BIN
assets/opensb/interface/title/starbound.png
Normal file
BIN
assets/opensb/interface/title/starbound.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 174 KiB |
4
assets/opensb/interface/windowconfig/title.config.patch
Normal file
4
assets/opensb/interface/windowconfig/title.config.patch
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
{
|
||||||
|
"skyBackdropDarken" : [0, 0, 0, 64],
|
||||||
|
"backdropImages" : [ [ [0, 0], "/interface/title/starbound.png", 0.5, [0.5, 0.5] ] ]
|
||||||
|
}
|
@ -79,17 +79,16 @@ void TitleScreen::render() {
|
|||||||
|
|
||||||
m_renderer->flush();
|
m_renderer->flush();
|
||||||
|
|
||||||
for (auto backdropImage : assets->json("/interface/windowconfig/title.config:backdropImages").toArray()) {
|
for (auto& backdropImage : assets->json("/interface/windowconfig/title.config:backdropImages").toArray()) {
|
||||||
Vec2F offset = jsonToVec2F(backdropImage.get(0)) * interfaceScale();
|
Vec2F offset = jsonToVec2F(backdropImage.get(0)) * interfaceScale();
|
||||||
String image = backdropImage.getString(1);
|
String image = backdropImage.getString(1);
|
||||||
float scale = backdropImage.getFloat(2);
|
float scale = backdropImage.getFloat(2);
|
||||||
|
Vec2F origin = jsonToVec2F(backdropImage.getArray(3, { 0.5f, 1.0f }));
|
||||||
Vec2F imageSize = Vec2F(m_guiContext->textureSize(image)) * interfaceScale() * scale;
|
Vec2F imageSize = Vec2F(m_guiContext->textureSize(image)) * interfaceScale() * scale;
|
||||||
|
|
||||||
Vec2F lowerLeft = Vec2F(windowWidth() / 2.0f, windowHeight());
|
Vec2F position = Vec2F(m_guiContext->windowSize()).piecewiseMultiply(origin);
|
||||||
lowerLeft[0] -= imageSize[0] / 2;
|
position += offset - imageSize.piecewiseMultiply(origin);
|
||||||
lowerLeft[1] -= imageSize[1];
|
RectF screenCoords(position, position + imageSize);
|
||||||
lowerLeft += offset;
|
|
||||||
RectF screenCoords(lowerLeft, lowerLeft + imageSize);
|
|
||||||
m_guiContext->drawQuad(image, screenCoords);
|
m_guiContext->drawQuad(image, screenCoords);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user