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 - G.

Pages: [1] 2 3 ... 63
1
Graphics / Re: The problem with the rectangleshape size
« on: March 08, 2025, 04:50:02 pm »
If your collision rectangle is different from your visual rectangle, then use a different rectangle (sf::FloatRect) for the collision and move it accordingly to the position of your RectangleShape

2
Nice

3
SFML website / Sticky menu hides linked content in the documentation
« on: February 26, 2025, 03:45:13 am »
Hi.

I saw in the new style for the documentation, and when you click on an anchor link the page will scroll accordingly, but the content will be hidden behind the top menu. Pretty annoying IMO.

For example on the RenderTarget page, click on the 2nd mapCoordsToPixel public member function. Or directly click here. I've included a screenshot with added transparency to demonstrate the problem.

Solution may be the scroll-padding-top or scroll-margin-top CSS properties? (not sure what the difference is)

4
SFML projects / Re: SF::View or SF::RenderWindow?
« on: February 26, 2025, 03:30:15 am »
Use mapPixelToCoords and mapCoordsToPixel to convert mouse coordinates to view coordinates, and vice versa.

I think people usually dislike when softwares use multiple windows for their different menus (but your mileage may vary...). You can use several views, one for your "main content" that probably moves or scales, and one (or more) for your user interface that is fixed.

5
General discussions / Re: Views and sprite world positions
« on: October 11, 2024, 02:53:56 pm »
Don't forget to draw your sprite. (maybe :p )
Make sure you draw your tilemap before the sprite, otherwise the tilemap will be drawn on top of the sprite and you won't see it.
If you call setView, draw your sprite between setView and display.

6
General / Re: Mouse Movements
« on: April 05, 2024, 12:18:07 pm »
It's impossible to answer without knowing how you do it. There's many ways to "move a sprite with the mouse".

7
System / Re: Small isKeyPressed question
« on: March 30, 2024, 12:44:53 am »
You don't get the keycode from isKeyPressed, you pass as an argument the one you want to check.
https://www.sfml-dev.org/tutorials/2.6/window-inputs.php#keyboard

8
General / Re: GPU usage jumping to 100% after changing resolution
« on: January 18, 2024, 05:46:19 am »
If you don't enable vsync (or don't set a framerate limit) it will take as many resources as it can to go as fast as possible.
I see you enable it at first, but you need to enable it again after you call create.

9
Graphics / Re: texture.loadFromFile string not working
« on: January 13, 2024, 12:58:23 am »
It's most likely that you mixed debug lib with release mode or mixed release lib with debug mode.
It is important to link to the libraries that match the configuration: "sfml-xxx-d.lib" for Debug, and "sfml-xxx.lib" for Release. A bad mix may result in crashes.

10
General / Re: Dragging a grid, *without* clicking on it
« on: November 11, 2023, 11:04:47 pm »
I'd register mouse position on MouseButtonPressed and set a bool "dragging" to true, check mouse position in MouseButtonReleased and set the "dragging" bool to false then if the 2 mouse positions are the same I activate the square.
On MouseMoved if dragging is true then I move the view. (I don't remember if the delta is inside the event data or if you have to compute it yourself)

That's pretty much how it works in your link. (if you manage to start and end you drag on the same position it activates the square)

11
Window / Re: ACCESS VİOLATİON ERROR?
« on: August 11, 2023, 04:51:20 pm »
Definitely need to initialize your pointer  ???

12
General / Re: Question
« on: August 10, 2023, 09:46:48 am »
Bare minimum for an input text box would be
sf::RectangleShape or sf::Sprite to display the box
sf::Text & sf::Font to display the the text
The TextEntered event to catch the text inputted by the user
and of course the mandatory basics of how to create a windows, a correct event and main loop

Could also use a GUI library like TGUI or SFGUI, but I don't know anything about them

13
General / Re: Difficulty with wall collision (FIXED)
« on: August 08, 2023, 09:50:43 pm »
Nothing, you can update the title with fixed or solved like you did but there's nothing more :)

14
General / Re: LNK2001 Error for unknown reason
« on: July 20, 2023, 04:05:00 pm »
That's literally not the same error though.

In one screenshot your path is c/libraries/sfml2.6, in the other one it's c/sfml2.6, is that right? ???

15
General / Re: LNK2001 Error for unknown reason
« on: July 19, 2023, 06:28:45 pm »
Looks like you also skipped the step where you configure the directories, at least the lib one.


Pages: [1] 2 3 ... 63
anything