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 - simiF

Pages: [1]
1
Ah, kojack, you were right. When I instantiate the window in my source code, I just set it to 1920x1080. I need to do some digging to see what that actually means across different native resolution screens.

I also need to look into what views are  ::)

Thanks, y'all!  ;D

2
I am not sure how the Insert Image works  :(. but the images are added as attachments

3
I am learning SFML by making Pong. My project is set up to build on Windows, MacOS, and Linux. I currently build on all 3 on every PR (thanks SFML template).

I also test on Windows and MacOS. I have made an odd observation, and I am not sure if it's an error on my side, or something funny going on with MacOS.

Below is a Windows screenshot, and both of the player and enemy paddles are perfectly aligned:


Below is a MacOS screenshot of the same build:


Some of the interesting observations:
  • Dividing Lane is perfectly down the middle
  • Both Player and Enemy paddles are shifted to the right

Below is the code snipped that determines the position of both paddles:
Player::Player(bool main_player, const float& width, const float& length)
        : _main_player{ main_player }, _width{ width }, _length{ length }, _size(_width, _length), _rect(_size)
{
    float x_pos_from_side = 200.f;

    float centered_y_pos = 0.5f * (_window_y_size - _length);
    float x_pos = _main_player ? x_pos_from_side : _window_x_size - x_pos_from_side - _width;

    _rect.setPosition(sf::Vector2f(x_pos, centered_y_pos));
}

Pages: [1]
anything