Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Gabriel_

Pages: [1]
1
Window / Re: "setSize()" does not work
« on: March 04, 2022, 01:32:58 pm »
Ok I managed to find a way to fix this by saving the value returned by the event and then checking in my main loop if the size ever becomes smaller than 600 and if it does I resize the window.

2
Window / Re: "setSize()" does not work
« on: March 04, 2022, 12:38:05 pm »
I replaced the "getSize()" with the size of the event by passing the event to the function but I still get the same result.

3
Window / "setSize()" does not work
« on: March 03, 2022, 06:59:18 pm »
Hello,

I use the function "setSize" to resize a window when the user makes it too small.
This same exact code worked fine on Windows 10 but on Linux Mint - Cinnamon it's giving me problems.

The code resizes the window only once in a while instead of constantly resizing.

This is my code:

void Game::proportionateWin()
{
        printf("Winsize : %4d %4d \n",w->getSize().x,w->getSize().y);

        //changes window size to the minimum size (WIN_MIN) (it's 600)
        if (w->getSize().x < WIN_MIN){
                w->setSize(sf::Vector2u(WIN_MIN, w->getSize().y));
                printf("resizing!");
        }
        ....
 
 

I call this function when the window gets resized here:

                if (event.type == sf::Event::Resized) {

                        //printf("resized\n");
                        proportionateWin();
                }

When I run my application every printf is triggered when making the window too small.
And yet the window does not resize.

Edit: Ok so I realized what makes the window resize: when I change the window size by dragging it fast it resizes immediatly but if I slowly drag the window the resizing doesn't take place.


4
General / Sprite disappearing after recreating window
« on: June 17, 2020, 05:38:43 pm »
I'm really new to SFML.
After i recreate a window one of my sprites disappears.
It's the sprite that i use to make the fade effect and it has a completely black 1080x1080 texture

this is the code that i used to recreate the window:

mainWindow->create(sf::VideoMode(screenX, screenY), "Game", sf::Style::Fullscreen);

Pages: [1]