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

Pages: 1 [2] 3 4 ... 658
16
Graphics / Re: Basic sprite questions
« on: July 06, 2021, 06:51:19 pm »
An SFML sprite just gives you an axis-aligned bounding box via getGlobalBounds() and it will match the texture/texture rect.

What is often done is to decompose the sprite shape into a bunch of smaller rectangles and use that as an approximation to your shape while still keeping the math kind of manageable.
This also allows you to for example pick a smaller bounding box around "hair" or other things you don't want to directly cause a collision, so you can fine tune the experience for the player.

17
General discussions / Re: Any plans releasing a stable 2.6 version?
« on: July 06, 2021, 05:17:36 pm »
Yes, the plan is to release it, as soon as the Scancode feature has been merged.
There are outstanding review comments that I need to implement and additional testing.

The progress of the release can also be seen here: https://github.com/SFML/SFML/projects/4

18
General / Re: cmake dependecies link
« on: July 06, 2021, 03:53:28 pm »
See the basic example in the following thread: https://en.sfml-dev.org/forums/index.php?topic=24070.0

If you don't know anything about CMake, then it's time to learn some ;)
- Official CMake
- It's Time To Do CMake Right
- Better CMake

19
General / Re: Would like tips on my Button class.
« on: July 01, 2021, 08:27:14 am »
There are various things you could enhance.

Starting with consistent function name formatting, i.e. either PascalCase or camelCase.
Some functions don't need to be public if you just call them internally.
You can derive from sf::Drawable and implement the draw() method, that way you can just write window.draw(button).
You may want to pass in a font, instead of holding onto one directly, that way you can reuse the font across multiple objects and you can handle resource loading in something like a ResourceHolder

20
Graphics / Re: Why doesn't Transformable contain size?
« on: June 30, 2021, 03:32:10 pm »
A transformable/transform is essentially just a 4x4 transformation matrix (math term) which encodes the movement, scaling and rotation but knows nothing about the original state.

Basically: original state * transformable = new state

21
General / Re: Help with pixel perfect collision on convex shapes.
« on: June 30, 2021, 02:24:35 pm »
Pixel Perfect collision detection is pretty much always overkill, plus it won't help you with implementing the reaction steps after the collision.

But you can find such (and other) implementation here: https://github.com/SFML/SFML/wiki/Source%3A-Simple-Collision-Detection-for-SFML-2

22
General / Re: Sprites-mouse input
« on: June 30, 2021, 02:22:16 pm »
You have to call clear, (draw) and display on the render window every frame without exception, because of double buffering, as kojack correctly mentioned.

If you want to "persist" some drawing across multiple frames, without tracking the actual list of sprites, you should be using a render texture.

23
General / Re: examples not working
« on: June 30, 2021, 02:19:29 pm »
If you didn't mingw32-make install target, and just launch the examples from the build directory, you'll be missing all the resources which then fails, while outputting error messages on the std::cerr
If you launch if from a terminal window, you should be seeing the error messages.

Note: Any application which uses sfml-audio will require the OpenAL DLL

If in doubt, you can also attach a debugger and see what happens exactly.

24
General / Re: M1 Support
« on: June 27, 2021, 03:41:02 pm »
Welcome! :)

No, SFML 2.5.1 has been released quite a while ago when the world knew nothing of an M1 chip.
Support for Apple silicon has already been merged, so you can use it by build SFML from source, or use a snapshot build.

25
General / Re: Code crashes upon using font.loadFromFile
« on: June 25, 2021, 03:55:30 pm »
Please provide the verbose built output: https://www.sfml-dev.org/faq.php#tr-grl-verbose-ide

26
General / Re: Code crashes upon using font.loadFromFile
« on: June 24, 2021, 01:01:51 pm »
i'm going to ask same thing expl0it3r always does:  ;D
what SFML package did you download? are you sure you downloaded the correct version for your architecture (64 / 32 bits)?
Hehe, that's a good hint ;)

Even though you said, you downloaded the 64bit version, are you also using the 64 compiler in Visual Studio?

27
General / Re: error generating makefile .exe file
« on: June 24, 2021, 01:00:31 pm »
Actually, they should be in the same directory as your executable and not the working directory.

I assume in VS Code they end up in the build folder, while when you run it yourself they aren't there.
You simply have to copy the DLLs next to your exe.

28
Graphics / Re: Scale offset
« on: June 24, 2021, 12:58:23 pm »
Scaling as any other transformation happens around/from the origin.
If your origin is set to the middle of the sprite, it will expand equally in all direction.
If your origin is set to the top left corner (default), then it will scale in the bottom right direction.

29
Graphics / Re: weird error with texture loading
« on: June 21, 2021, 03:40:51 pm »
Or you might be linking release libraries in debug mode.
Make sure you use debug libraries in debug mode and release libraries in release mode.

30
General / Re: Visual Studio 2019 compatibility
« on: June 19, 2021, 02:14:18 am »
No, with the Universal CRT, you can use the libraries across multiple Visual Studio versions, meaning VS 2017 also work with VS 2019

Pages: 1 [2] 3 4 ... 658
anything