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

Pages: [1]
1
Graphics / Why doesn't Transformable contain size?
« on: June 30, 2021, 11:54:20 am »
I'm trying to create a simple layout helper class, which would be static, so that for example I would be able to call something like Layout.Align() and pass to it the element(s) I want to be aligned relatively to some bounds. According to the documentation, sprites, shapes and text are inherited from Transformable. This is awesome, I thought, because I don't have to implement separate methods for sprites and shapes for example. I can just upcast them to Transformable and pass these instead. But the problem is that Transformable doesn't contain the size of the element. Of course I can pass the size of the elements along with the elements themselves using GetGlobalBounds method. But I'm just curious why Transformable doesn't contain size, or why sprites, text, etc. don't implement some interface, like Bounded idk, because all of them have GetGlobalBounds method. Oh, and by the way I use SFML.NET 2.5.0 in case it is important.

Pages: [1]