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 ... 4 5 [6] 7 8 ... 63
76
Graphics / Re: Is there a better way to draw multiple points
« on: April 11, 2021, 12:52:52 am »
You could use an sf::VertexArray, fill it with your points and draw the VertexArray once (with the sf::PrimitiveType::Points primitive type) instead of drawing each Vertex independently.
(Possibly an sf::VertexBuffer but I don't know much about them)

Pretty Sure it's gonna be a lot faster.

77
Audio / Re: Music starts playing when I close the window
« on: March 21, 2021, 04:52:14 am »
When you call play on a sound or music that is already playing it restarts from the beginning, so if you're calling play every frame, your music restarts every frame, so you never have enough time hear it.

Don't call it your loop. Or don't call it if it's already playing, or call it only once when you want it to start.

78
General / Re: How to always draw texture in its original resolution?
« on: March 15, 2021, 04:04:28 am »
Draw on an sf::View that is the same size as the window.
If the window gets resized, resize the view accordingly. https://www.sfml-dev.org/tutorials/2.5/graphics-view.php#showing-more-when-the-window-is-resized

79
In the project's properties, add:
- The path to the SFML libraries (<sfml-install-path>/lib) to Linker » General » Additional Library Directories
Most likely you didn't follow this step for your release settings.

80
Graphics / Re: Change the blend mode used by Texture::update
« on: February 19, 2021, 02:00:43 pm »
You don't. Update replaces pixels by other pixels.

If you want to draw a texture onto another texture, use an sf::RenderTexture.

81
General / Re: How to get rid of the white border on images
« on: February 08, 2021, 08:47:52 pm »
Not sure what you mean. A picture of the image and what it looks like in your project would help.

82
SFML website / Re: File missing from Window SFML2.5.1/32 for VS2017?
« on: February 07, 2021, 10:40:42 pm »
It's sfml-main whether it's dynamic or static, it only redefines the main.

83
Graphics /  
« on: February 07, 2021, 12:42:36 pm »
createMaskFromColor is an sf::Image method.

https://en.sfml-dev.org/forums/index.php?topic=5874.msg38603#msg38603

But if your picture already has transparency you don't need to create a mask  ???

84
Graphics / Re: How do I set a position/scale etc on a single axis?
« on: February 06, 2021, 03:34:10 am »
Perfectly fine

85
It's unrelated to move or setPosition.
sf::Vector2f is a vector of floats, and you can multiply it by floats.
* 100 is multiplying by an int, that is automatically converted to a float.
* 0.5 is multiplying by a double, that is not automatically converted to a float.

0.5 is a double
0.5f is a float

86
SFML projects / Re: Dispersio 2
« on: January 25, 2021, 04:43:21 pm »
Hello

I only played in hard and am a breathtaking treasure hunter after 4h30. 8)
I think hard mode made the game more tedious than hard though. :(
The game experience is probably a bit different if one plays in easy/normal.

I'll put my gripes in spoilers because it's spoilery.
(click to show/hide)

87
General / Re: Can't stop the sprite from moving
« on: January 24, 2021, 02:32:11 pm »
Hey.
They are not random numbers, they are very tiny numbers written in scientific notation.
3.22666e-12 means 3.22666 * 10^-12 which means 0.00000000000322666...

Set your velocity to 0 when it is very close to 0 and isMoving is false.
Something like < to 0.01 and > to -0.01 or whatever feels good to your game.

88
You could check the status of your sound and not play it if it is already "Playing"

89
Are you calling playItemChime every frame and thus calling play every frame while m_IsColliding is true?

When you call play on a sound that is already playing it restarts it from the beginning, so if that's what you're doing your sound is restarting every frame so you never have enough time hear it.

WTF, why do you use a picture to show text?

90
Graphics / Re: Textures not loading, and I tried EVERYTHING
« on: December 08, 2020, 04:49:47 am »
Random symbols in the console usually happens when you're mixing debug and release. (when you're using the release version of SFML but compiling in debug mode, or debug version and compiling in release mode)

Pages: 1 ... 4 5 [6] 7 8 ... 63
anything