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 ... 57
1
You could check the status of your sound and not play it if it is already "Playing"

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

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

4
Graphics / Re: Textures not loading, and I tried EVERYTHING
« on: December 08, 2020, 02:35:22 am »
Any error message? Something in the console? Have you tried checking the return value of loadFromFile?
WTF happens when you run your code... we don't know

5
Window / Re: First VideoMode is larger than my screen
« on: December 02, 2020, 09:16:53 am »
getFullscreenModes is the list of the video modes supported by your screen.
getDesktopMode is the current video mode of your screen.

6
General / Re: Write a text when an object/or shape is clicked
« on: November 23, 2020, 01:06:19 am »
What part do you have trouble with?
Detecting the click on your shape?
Capturing the keyboard inputs?
Writing a text on the screen?

7
Window / Re: Creating a fullscreen window doesn't hide the taskbar
« on: November 19, 2020, 11:47:49 am »
Is 320 200 a supported fullscreen resolution by your screen?
Can check if it's in getFullscreenModes or with isValid https://www.sfml-dev.org/documentation/2.5.1/classsf_1_1VideoMode.php#ad5e04c044b0925523c75ecb173d2129a

8
Window / Re: how scale window
« on: November 14, 2020, 08:16:32 am »
Use an sf::View of size 320*240, its content will be stretched to whatever your window size is.
https://www.sfml-dev.org/documentation/2.5.1/classsf_1_1View.php
https://www.sfml-dev.org/tutorials/2.5/graphics-view.php

9
Window / Re: Positioning Text in Window
« on: November 06, 2020, 02:23:34 am »
You don't have any font.
Before drawing any text, you need to have an available font, just like any other program that prints text.

10
General discussions / Re: Keeping PointLight shader centered on player
« on: October 30, 2020, 07:30:27 am »
Hey.

You can use mapCoordsToPixel to convert the position of your player in the world into its position in the window, thus getting the light position.

11
Graphics / Re: Sprite is blank after loading from texture
« on: October 18, 2020, 03:41:53 am »
https://www.sfml-dev.org/tutorials/2.5/graphics-sprite.php#the-white-square-problem
https://www.sfml-dev.org/faq.php#graphics-white-rect

Your texture is local to the Menu constructor, thus it is destroyed at the end of the constructor.
You could make it a member of Menu, or declare the variable in your main and pass it (by ref) to your constructor, or anything that doesn't destroy the texture while you still need it.

12
Graphics / Re: SFML Draw() won't draw sprite on Window
« on: October 14, 2020, 11:04:30 am »
Are you sure it's not drawn at the top of the screen?
Because 5 / 6 is equal to 0

13
Graphics / Re: I can't get the math right. [SOLVED]
« on: October 04, 2020, 09:53:12 am »
In trigonometry, 0 radians (or 0°) is on the right of the circle.


14
Graphics / Re: Rotations About Center of Circle
« on: October 04, 2020, 09:48:20 am »
Hey.

This has nothing to do with rotation, but with origin and position. Origin is not only the center of rotation, but also the anchor of its position.
If your origin and position are 0, 0 and 0, 0 then the circle top left "corner" will be in 0, 0
If your origin and position are 100, 100 and 0, 0 then the circle top left "corner" will be in -100, -100 thus you'll only see its bottom right quadrant.

(and your assumption is right, when you rotate a circle around its center, you won't see any change)

15
Graphics / Re: I can't get the math right.
« on: October 02, 2020, 07:50:51 pm »
std::cos and std::sin use radians

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