bongocat-osu icon indicating copy to clipboard operation
bongocat-osu copied to clipboard

Feature: Window size configuration

Open r4ulill0 opened this issue 4 years ago • 4 comments

I'm trying to modify the cat adding him hats but the window dimensions aren't high enough. It could be useful to have a quick configuration for the window dimensions. Having to compile the source to resize the window is a bit of a trouble.

r4ulill0 avatar Jul 20 '20 20:07 r4ulill0

Sure, let me see what I can do about it, because the image resolution is pretty fixed so I need to find some way to resize the window without breaking the artifacts.

kuroni avatar Aug 12 '20 02:08 kuroni

I have learnt a bit of c++ and I'm trying to figure out how to solve this. I got to compile the project and change the height directly in the code, the only problem is that every sprite starts rendering from the top so I only get a big white empty space below all the images.

I see that width and height are kind of hardcoded but I haven't found where yet.

https://github.com/kuroni/bongocat-osu/blob/0714582791529af714bc9a6a6a6f77497c7c561d/src/main.cpp#L15

If it's not problematic I'm thinking about moving the reading config part before the creation of the window so I can access the configuration, adding two new fields in decoration "extraHeight" and "extraWidth" (I'm going to start with extra dimensions, I think it will be easier that way).

I'm new to SFML so I hope the code doesn't end up too messy. You can asign this issue to me if you want 😄 .

r4ulill0 avatar Sep 15 '22 18:09 r4ulill0

I think just calling window.draw() with a sf::RenderStates created with a sf::Transform translation is enough.

I got this result after calling the first window.draw() with it (the one that renders the background). Maybe I can find a solution this weekend. image

r4ulill0 avatar Sep 15 '22 18:09 r4ulill0

Seems to work. I will do some cleaning tomorrow and open the pull request.

image

r4ulill0 avatar Sep 15 '22 18:09 r4ulill0