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

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.

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.

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.

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)

« on: August 11, 2023, 04:51:20 pm »
Definitely need to initialize your pointer  ???

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

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 :)

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

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.

General / Re: LNK2001 Error for unknown reason
« on: July 19, 2023, 11:15:47 am »
First, why are you posting a screenshot of you not linking the lib?
Looks nothing like the screenshot in the tutorial

It looks like you're compiling in x64 in your 2nd screenshot, but you show us your configuration for win32. Make sure you include the headers and link the lib for the x64 platform.

Follow the tutorial, pretty much.

General / Re: Can't compile project
« on: July 17, 2023, 10:03:10 am »
You didn't link the freetype dependency, not sure if that's the only problem.

SFML website / Re: SFML Website Design
« on: June 07, 2023, 06:51:19 pm »
That's a bit of an exaggeration. Maybe it would smell fishy/oldschool to the average tiktoker but I don't think any C++ developer would associate it with viruses of phising :o
Don't even look at the SDL website :D

General / Re: How to link everything statically
« on: May 29, 2023, 05:19:44 pm »
Wrong linking order isn't it? It's supposed to be dependencies last (dependencies are listed in the link provided by hapax)

Graphics / Re: Problem when zooming
« on: May 02, 2023, 06:12:11 pm »
Yes, definitely make 2 different view, one where you draw the main game and apply the zoom, and another one with the UI, text and minimap.
Nothing is drawn unless you explicitely draw something, so views are transparent by default.

Pages: [1] 2 3 ... 63