Skip to content

Commit

Permalink
fix window sizes for new resolution 640 x 480
Browse files Browse the repository at this point in the history
  • Loading branch information
Limeoats committed Jan 26, 2017
1 parent b12cf37 commit fe47521
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 31 deletions.
2 changes: 1 addition & 1 deletion .gitignore
@@ -1,5 +1,5 @@
.idea/*
build/*
*~

*.swp
cmake-build-debug
Binary file modified bin/Lime2D/lib/libLime2D.a
Binary file not shown.
Binary file added content/tilesets/outside_1.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
28 changes: 14 additions & 14 deletions imgui.ini
Expand Up @@ -34,17 +34,17 @@ Size=94,71
Collapsed=0

[Select a map]
Pos=150,165
Pos=70,105
Size=500,270
Collapsed=0

[Properties]
Pos=284,163
Size=247,157
Pos=69,73
Size=541,318
Collapsed=0

[Light editor]
Pos=250,100
Pos=170,40
Size=300,400
Collapsed=0

Expand All @@ -60,12 +60,12 @@ Collapsed=0

[Animation editor]
Pos=10,40
Size=780,520
Size=620,400
Collapsed=0

[Configure]
Pos=70,4
Size=500,480
Pos=80,50
Size=480,380
Collapsed=0

[Create new anim]
Expand All @@ -89,12 +89,12 @@ Size=280,100
Collapsed=0

[New map properties]
Pos=150,125
Size=500,350
Pos=90,115
Size=460,250
Collapsed=0

[Entity list]
Pos=150,150
Pos=70,90
Size=500,300
Collapsed=0

Expand All @@ -104,12 +104,12 @@ Size=300,400
Collapsed=0

[Configure map]
Pos=200,175
Size=400,250
Pos=140,150
Size=360,180
Collapsed=0

[Console]
Pos=100,75
Size=600,450
Pos=60,50
Size=520,380
Collapsed=0

29 changes: 14 additions & 15 deletions src/lime2d.cpp
Expand Up @@ -623,9 +623,9 @@ void l2d::Editor::update(sf::Time t) {
static bool loaded = false;

ImGui::SetNextWindowPosCenter();
ImGui::SetNextWindowSize(ImVec2(500, 480));
ImGui::SetNextWindowSize(ImVec2(480, 380));
static std::string configureMapErrorText = "";
ImGui::Begin("Configure", nullptr, ImVec2(500,480), 100.0f, ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_ShowBorders);
ImGui::Begin("Configure", nullptr, ImVec2(480,380), 100.0f, ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_ShowBorders);

ImGui::PushID("ConfigureMapPath");
ImGui::Text("Map path");
Expand Down Expand Up @@ -839,9 +839,9 @@ void l2d::Editor::update(sf::Time t) {
if (newMapBoxVisible) {
this->_currentWindowType = l2d_internal::WindowTypes::NewMapWindow;
ImGui::SetNextWindowPosCenter();
ImGui::SetNextWindowSize(ImVec2(500, 350));
ImGui::SetNextWindowSize(ImVec2(460, 250));
static std::string newMapErrorText = "";
ImGui::Begin("New map properties", nullptr, ImVec2(500, 350), 100.0f, ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_ShowBorders);
ImGui::Begin("New map properties", nullptr, ImVec2(460, 250), 100.0f, ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_ShowBorders);
ImGui::Text("Name");
static char name[500] = "";
ImGui::PushItemWidth(300);
Expand Down Expand Up @@ -1012,7 +1012,6 @@ void l2d::Editor::update(sf::Time t) {
}
}
if (this->_level.isLoaded()) {
std::cout << _level.getName() << std::endl;
ImGui::Separator();
if (ImGui::BeginMenu("Add", this->_currentMapEditorMode == l2d_internal::MapEditorMode::Object)) {
if (ImGui::BeginMenu("Light")) {
Expand Down Expand Up @@ -1819,8 +1818,8 @@ void l2d::Editor::update(sf::Time t) {
if (configureMapWindowVisible) {
this->_currentWindowType = l2d_internal::WindowTypes::ConfigureMapWindow;
ImGui::SetNextWindowPosCenter();
ImGui::SetNextWindowSize(ImVec2(400, 250));
ImGui::Begin("Configure map", nullptr, ImVec2(400, 250), 100.0f, ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_HorizontalScrollbar | ImGuiWindowFlags_ShowBorders);
ImGui::SetNextWindowSize(ImVec2(360, 180));
ImGui::Begin("Configure map", nullptr, ImVec2(360, 180), 100.0f, ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_HorizontalScrollbar | ImGuiWindowFlags_ShowBorders);
ImGui::PushItemWidth(100);
ImGui::PushID("ConfigureMapSize");
ImGui::Text("Map size (in tiles)");
Expand Down Expand Up @@ -1881,8 +1880,8 @@ void l2d::Editor::update(sf::Time t) {
if (this->_showConsole) {
this->_currentWindowType = l2d_internal::WindowTypes::ConsoleWindow;
ImGui::SetNextWindowPosCenter();
ImGui::SetNextWindowSize(ImVec2(600, 450));
ImGui::Begin("Console", nullptr, ImVec2(600, 450), 60.0f, ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_HorizontalScrollbar | ImGuiWindowFlags_ShowBorders);
ImGui::SetNextWindowSize(ImVec2(520, 380));
ImGui::Begin("Console", nullptr, ImVec2(520, 380), 60.0f, ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_HorizontalScrollbar | ImGuiWindowFlags_ShowBorders);
ImGui::TextWrapped("This is the Lime2D console. You can enter commands into the textbox below, press enter, and the commands will be executed.");
ImGui::TextWrapped("Type '/help' for a list of commands.");
//ImGui::Separator();
Expand All @@ -1906,7 +1905,7 @@ void l2d::Editor::update(sf::Time t) {
ImGui::PopStyleVar();
ImGui::EndChild();
ImGui::Separator();
ImGui::PushItemWidth(584);
ImGui::PushItemWidth(504);
if (ImGui::InputText("", consoleInputBuffer, IM_ARRAYSIZE(consoleInputBuffer), ImGuiInputTextFlags_EnterReturnsTrue | ImGuiInputTextFlags_CallbackCompletion | ImGuiInputTextFlags_CallbackHistory, nullptr, (void*)this)) {
char* inputEnd = consoleInputBuffer + strlen(consoleInputBuffer);
while (inputEnd > consoleInputBuffer && inputEnd[-1] == ' ') --inputEnd;
Expand Down Expand Up @@ -2103,7 +2102,7 @@ void l2d::Editor::update(sf::Time t) {
ss << l2d_internal::utils::getConfigValue("animation_path") << "*";
std::vector<const char*> existingAnimationSprites = l2d_internal::utils::getFilesInDirectory(ss.str());

ImGui::PushItemWidth(500);
ImGui::PushItemWidth(400);
if (ImGui::Combo("Choose an animated sprite", &animationSpriteSelectIndex, &existingAnimationSprites[0], static_cast<int>(existingAnimationSprites.size()))) {
animationSelectIndex = -1;
selectedAnimationFileName = existingAnimationSprites[animationSpriteSelectIndex];
Expand Down Expand Up @@ -2131,7 +2130,7 @@ void l2d::Editor::update(sf::Time t) {
timeToUpdate = script.get()->get<float>("animations.list." + existingAnimationsStrings[animationSelectIndex] + ".time_to_update");
};
static bool loaded = false;
ImGui::PushItemWidth(500);
ImGui::PushItemWidth(400);
if (ImGui::Combo("Choose an animation", &animationSelectIndex, &existingAnimations[0],
static_cast<int>(existingAnimations.size()))) {
loaded = false;
Expand Down Expand Up @@ -2177,7 +2176,7 @@ void l2d::Editor::update(sf::Time t) {
}
}

ImGui::PushItemWidth(500);
ImGui::PushItemWidth(400);
ImGui::PushID("AnimationName");
static char animationNameArray[500] = "";
if (!loaded) {
Expand All @@ -2188,7 +2187,7 @@ void l2d::Editor::update(sf::Time t) {
ImGui::PopItemWidth();
ImGui::Separator();

ImGui::PushItemWidth(500);
ImGui::PushItemWidth(400);
ImGui::PushID("AnimationDescription");
static char animationDescriptionArray[1000] = "";
if (!loaded) {
Expand All @@ -2199,7 +2198,7 @@ void l2d::Editor::update(sf::Time t) {
ImGui::PopItemWidth();
ImGui::Separator();

ImGui::PushItemWidth(500);
ImGui::PushItemWidth(400);
ImGui::PushID("AnimationSpriteSheet");
ImGui::Combo("Sprite sheet", &spritesheetSelectIndex, &spriteList[0], static_cast<int>(spriteList.size()));
ImGui::PopID();
Expand Down
2 changes: 1 addition & 1 deletion src/main.cpp
Expand Up @@ -13,7 +13,7 @@
using namespace std;

int main() {
sf::RenderWindow window(sf::VideoMode(800, 600), "Lime2D", sf::Style::Titlebar | sf::Style::Close);
sf::RenderWindow window(sf::VideoMode(640, 480), "Lime2D", sf::Style::Titlebar | sf::Style::Close);
sf::Image img;
img.loadFromFile("content/sprites/mstile-310x310.png");
window.setIcon(img.getSize().x, img.getSize().y, img.getPixelsPtr());
Expand Down

0 comments on commit fe47521

Please sign in to comment.