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

Pages: [1]
1
General discussions / Re: Is it just me, or SFML is very well written
« on: April 12, 2021, 04:05:38 pm »
The API/Code itself is pretty clean and easy to understand. But SFML is still C++03. I would have agreed with you on SFML being well written if you asked that question 10-15 years ago.

But the way you write modern C++ is very different. Especially C++ 11 had a major impact on how C++ code is written. I don't think i would call a library that doesn't make use of features like smart pointers, doesn't support move semantics and still uses workarounds like sf::NonCopyable instead of =delete in 2021 well written.

2
Graphics / Re: Seams between isometric tiles
« on: July 15, 2019, 05:22:35 pm »
I got it to work by accident now. I swapped from the own shape for each tile approach to a vertex array containing all tiles. For some reason with the vertex array while using the exact same texture the seams are gone.  So it seems like it wasnt the texture tho. Maybe it has to do with the texture coordinates being set manually now.

3
Graphics / Seams between isometric tiles
« on: July 14, 2019, 11:03:21 am »
Im currently trying to implement a isometric tilemap in sfml. The map itself is working but for some reason i get a 1 pixel gap between my tiles:

I tried both, a rectangle shape with width of 100 and height of 50 drawn with the right offsets aswell as a convex shape that matches the tile exactly with the same result. I dont think its my placing code because if i use a fill color instead of a texture the tiles line up perfectly without any visible seams. Is there something about textures im missed that explains where the seam is coming from?

4
Graphics / Changing drawable object on draw
« on: September 06, 2018, 11:42:01 am »
Hey,

im currently writing a Button class that derives from sf::Drawable and sf::Transformable. The basic shape of the Button is a sf::RectangleShape together with some other stuff thats not really relevant for the question.

I want the "OutlineColor" to change when the mouse is currently within the sf::RectangleShape. I got it to work within a public function of my Button class, but that means every time you draw a instance of a Button you have to call that function in advance so the color gets changed correctly.

Basicly i want to automaticly check the Mouse position and change the OutlineColor every time the Button gets drawn by the derived virtual void draw(sf::RenderTarget& target, sf::RenderStates states) const; .

However because of the const any changes to the object from within that function are prevented. So i cannot call my function from there. Is there any way to create some sort of OnDraw event or get your object editable from within the const draw function?


Pages: [1]