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.


Topics - jfknyc

Pages: [1]
1
General / How to detect collision when RenderWindow has an sf::View?
« on: August 12, 2020, 10:16:06 pm »
Hello. I'm working on a game that uses sf::View to let the user pan and scroll around the map. However, despite lots of work, I can't find a way to have any type of collision detection (either FloatRect methods or simple math) work with sf::View.

Let's say I start with a rectangle in the center of the window, and pan such that it's now at the bottom right corner. Using .getGlobalBounds().intersects... doesn't register anything when I click the rectangle in the bottom right — only when I click where the rectangle started. Using math (mouse.x > rect.getPosition().x) doesn't work either; I don't think any aspect of a RectangleShape changes when it moves on the window due to an sf::View.

So, is there any way for me to factor a View into the calculations when I want to do collision detection?

(Any help would be appreciated!)

2
General / How to port from Mac to Windows
« on: June 27, 2020, 07:00:00 pm »
Hello. I've been using my Mac to create an SFML project in XCode, and now my friend — on Windows — wants to take a look at it. I've searched Google and the SFML forums only to find questions asking how to port to Mac, so any advice or help would be very appreciated. Thanks!

Pages: [1]