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] 4 5 ... 63
31
Graphics / Re: SFML 2.0 Class Text without outline
« on: August 11, 2022, 09:47:42 am »
Text outlines were added (setOutlineThickness & setOutlineColor) in SFML 2.4 exactly 6 years ago, any reason you don't want to use a more recent version of SFML?

Anyway, if you can't update to 2.5, you can make an outline by drawing the same text 8 times around your text with 1 (or more) pixel offset in each direction, or create an outline in a fragment shader if you know some GLSL.

32
You could have 2 sprites with the same road texture, display them next to each other, then when one disappears from your view, you move it back to the top, and so on.

Alternatively, you could set your road texture as repeated, move the TextureRect of your road sprite the same amount as your view, and draw your road sprite on a different view that doesn't move.

33
Graphics / Re: TextEntered input repeats
« on: July 06, 2022, 07:34:08 am »
Never use event outside of your pollEvent loop

34
General / Re: Why it so hard to install and do not works?
« on: June 12, 2022, 04:58:18 pm »
It's C++.

Have you tried following the official tutorial, without skipping any part? It's not that hard  ???

35
Graphics / Re: Sf::View and How can i fix things on display?
« on: May 22, 2022, 10:03:07 am »
Draw them on another view that doesn't move.
window.setView(scrollableView);
// draw your gameplay here
window.setView(fixedView);
// draw your user interface here

36
General / Re: How to set SFML up for VS and not per project
« on: May 21, 2022, 06:39:00 pm »
Don't know about 2022 but in Visual Studio 2019, I created a base SFML project and then I chose "Export template" from "Project" in the main menu.
Afterwards when I create a new project I can chose to use this as a template.

37
General / Re: String erase problem while using Event::TextEntered
« on: March 20, 2022, 07:36:06 pm »
In your TextEntered event, don't add the character to your string if it is equals to the backspace character ( '\b' ).

In your current code you delete the last char in the KeyPressed event, and then you also add the backspace character in your TextEntered event, it is probably invisible. On further backspace key presses you delete that invisible character then add a new one. That's why it looks like it's not doing anything.

38
General / Re: Hitbox
« on: March 18, 2022, 07:28:24 am »
Hello.
If your buttons or menu elements are sf::Sprite or sf::RectangleShape you can get the bounding box of your button with the getGlobalBounds function. Once you have its bounding box you can use it as an hitbox and use its contains function to check if the mouse coordinates are inside of it.
(You can also write your own hitboxes instead of using the bounding boxes if you want a smaller clickable region for example, but I think you'll get the idea)

39
General / Re: How to use correctly the trigger
« on: March 07, 2022, 06:37:00 pm »
https://www.sfml-dev.org/tutorials/2.5/window-inputs.php#joystick
Joysticks and triggers aren't buttons, they are axis, use sf::Joystick::getAxisPosition and you can consider it "pressed" when it crosses a threshold

40
Window / Re: nothing is moving on screen
« on: January 17, 2022, 09:23:21 pm »
You have an infinite (until there's a Closed event) loop inside your isClosing function.

41
General / Re: Visual Studio 2019 Cannot find file “SFML/Graphics.hpp”
« on: January 07, 2022, 08:53:52 am »
Eager to see, I really wonder what the official SFML tutorial is missing

42
General / Re: Visual Studio 2019 Cannot find file “SFML/Graphics.hpp”
« on: January 06, 2022, 07:07:48 pm »
Did you do it for the correct configuration? (debug/release, 32bits/64bits)

43
General / Re: Code::Blocks - Cannot find libraries?
« on: January 05, 2022, 07:11:40 am »
I'm not sure if that's the only problem, but if you want to link the static version of SFML you need to link
sfml-graphics-s (or sfml-graphics-s-d if debug) and I see -lsfml-graphics in your log without the -s (nor the -d)
On top of that if you're in static, you also have to link every needed dependencies, in the correct order. You can find the list in the table in the 2nd half of the tutorial

Also make sure the sfml package you're using was compiled with the same compiler/version as the one you're using.


BTW when you have everything working, you can create a template project in codeblocks so that you won't have to set up everything again in new projects. I don't remember how but it should be easy

44
General / Re: Weird Watermark "NO DC" at top left
« on: January 02, 2022, 08:43:04 am »
Not related to SFML but to nvidia drivers it seems, and you'll get several results (example) when searching for nvidia "no dc" on your search engine of choice

45
General / Re: Creating an input field
« on: December 14, 2021, 08:35:55 pm »
Get the character typed with the TextEntered event.
To get only letters and number check the unicode value or use std::isalnum I think

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