New answers tagged sfml
Box2d has a body type that fits your need: KinematicBody. Kinematic bodies aren't affected by collisions, you programmatically set their velocity from outside of Box2d. Also you can directly set their positions, instead of manipulating their speed, though it's not recommended. In case when you set kinematic bodies' speed, their position is still controlled ...
Set the UVs from the (X,Z) or (X,Y) vertex coordinates of your light mesh (depending on your world setup) relative to the light center. vertex.uv = vec2(0.5, 0.5) + (vertex.pos.xy - light_center.xy) * scaling; Assign that fading texture to your light mesh and set the texture mapping to clamp (or clamp to edge) Use the scaling value to control the fading ...
You have to check if the player is too close to a side and move the view accordingly. If he is too much on one side then you don't center the view on him anymore. Here is an example of how I would do it. (I haven't tested it) //View is your current view. //Position is the position you want to center the view on. //Size is the size of your "area". void ...
What's happening is you're clearing the screen after drawing the text. So this window.draw(text); window.clear(sf::Color::Green); should be this window.clear(sf::Color::Green); window.draw(text); If it still doesn't display anything, you definitely need to set a font!
sf::Context context; creates a valid OpenGL context. You can find more info in the official tutorial or the documentation.
There's two common pitfalls when using a static library on Windows, one being particular to your linker: Symbols exported from DLLs have __declspec(dllexport) decoration and need to be __declspec(dllimport) decorated on use. Software tends to have defines like SFLM_STATIC whose presence or absence indicate the right mangling to use. The GNU linker is ...
Top 50 recent answers are included