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

Pages: 1 ... 15 16 [17] 18 19 ... 34
241
Graphics / Re: Draw very big tilemaps
« on: January 28, 2017, 11:09:34 am »
This is my favourite method of drawing tilemaps. A large map of 1000x1000 tiles or more can be stored in a single texture of the same dimensions, with the bonus of hardware cropping on the GPU and reduction of any tearing artifacts caused by vertex arrays. I believe there is a practical example of it on the SFML wiki.

242
Graphics / Re: Scene-graphs and multiple sf::views
« on: January 28, 2017, 10:57:44 am »
My solution was to wrap the view in a 'camera' component. This way its movement can be dictated by the entity to which it is attached, theoretically a player, or an off scene area dedicated to laying out the UI. The scengraph (in the Scene class) is drawable, so in pseudocode works like:

m_scene.setActiveCamera(sceneCam);
rw.draw(m_scene);
m_scene.setActiveCamera(uiCam);
rw.draw(m_scene);
 

There's more detail on the project wiki

243
SFML projects / Re: Last of the Ambaras
« on: January 22, 2017, 11:02:33 pm »
The key here I think is the contrast between the object and foreground which makes it stand out more. Perhaps you should also check out rim lighting to emulate a backlight, an effect I know valve uses in dota2. This can be painted on the sprites or applied as a realtime effect with shaders

244
Graphics / Re: Help wanted with colliders/collision
« on: January 01, 2017, 11:57:12 pm »
I wrote a short intro to collisions using SFML which might help.

245
Unless the dll you made was built by statically linking SFML (so that the SFML parts are contained within it) you link your project to SFML as any other SFML project, as well as linking to your game engine.

246
Graphics / Re: Drawing sf::Sprite together with OpenGL 4.x
« on: December 09, 2016, 10:39:55 pm »
SFML requires compatibility mode to be on in OpenGL.
You need to change "core" to "compatibility" in your shaders.

To clarify: SFML requires compatibility mode when mixing with SFML drawing - you can still get core contexts when using just the window module. Also it means no OS X support, as OS X only supports core profiles.

247
SFML projects / Re: Screenshot Thread
« on: December 04, 2016, 09:50:30 pm »
A little tamagotchi / LCP inspired game which will hopefully make it to mobile :)


248
SFML projects / Re: Blast To The SpaceCraft
« on: December 04, 2016, 09:46:09 pm »
Nice! Did you make the music too? I really like the starfield effect. I might ask though if you could add keybinds? Because my hand naturally went to A/D to move (I like to play one handed so I can still drink my coffee in my break ;) )

249
General / Re: Ball in Pong only moves in 4 directions
« on: November 22, 2016, 10:49:37 am »
I actually did a blog post on this a little while back.

250
Graphics / Re: Shaders make my Sprite disappear
« on: November 19, 2016, 06:48:33 pm »
SFML has a fixed vertex format - so by default you don't need to create a vertex shader. In your fragment shader vColor and vTexCoord will be replaced by gl_Color and gl_TexCoord[0].xy (you don't need to define them as inputs/varyings)

251
Graphics / Re: SFML mouse input mode.
« on: November 18, 2016, 03:26:29 pm »
In the past I've done something like:

init()
{
    setMousePos(screenCentre);
}

onMouseEvent()
{
    movement = mousePos - screenCentre;
    doStuff(movement);
    setMousePos(screenCentre);
}

 

basically you manually set the mouse to the centre of the screen each time you get a mouse move event, after having measured the distance between the mouse and the centre of the screen.

252
SFML projects / tmxlite - a Tiled map editor / tmx parser - v1.0.1 Released
« on: November 15, 2016, 04:21:18 pm »
This is meant to be a portable parsing library which can be used with any graphics rendering library, including SFML. The 'lite' part refers to the library not needing any external dependencies such as boost or zlib, while still supporting compressed map formats. I'm posting it here in case anyone finds this useful (there's an SFML example included in the repository).

Github

253
General / Re: "infinite" tilemap - please rate & help improve
« on: November 11, 2016, 10:18:11 pm »
Coincidentally I've been working on something similar myself, and have been blogging my musings, if that's any help.

254
Window / Re: Aspect ratio confusion
« on: October 01, 2016, 11:38:03 pm »
Like this?

255
Graphics / Re: How to make transparent RenderTexture?
« on: September 26, 2016, 08:47:04 pm »
Clear it with a transparent colour:

renderTexture.clear(sf::Color::Transparent);
renderTexture.draw(stuff);
renderTexture.display();
 

Pages: 1 ... 15 16 [17] 18 19 ... 34