|
| | OffsetComponent (sf::Vector2f offset=sf::Vector2f(0.0f, 0.0f)) |
| | Constructs the component with an optional offset.
|
| virtual | ~OffsetComponent ()=default |
| sf::Vector2f | getOffset () const |
| | Returns the current offset.
|
| void | setOffset (sf::Vector2f offset) |
| | Updates the logical offset value.
|
| void | addOffset (sf::Vector2f delta) |
| | Increments the current offset by a given vector.
|
| void | debugPrint () const |
| | Outputs the current offset value to the console for debugging.
|
| virtual | ~Component ()=default |
| virtual void | enable () |
| virtual void | disable () |
| bool | isEnabled () const |
| | Checks whether the component is currently active.
|
| void | setParent (Entity *parent) |
| | Sets the parent entity of this component.
|
| Entity * | getParent () const |
| | Returns the parent entity of this component.
|
ECS component that defines a logical coordinate offset.
This component stores a 2D offset (in logical units) applied to graphical elements such as axes, curves, titles, labels and data points. It allows changing the visual reference frame without affecting pixel-based positioning.
Usage Examples:
- With offset = ( 0, 0 ), logical coordinates are drawn as-is.
- With offset = ( -20, 0 ), the visual origin is shifted 20 units to the right.
The offset is often combined with the origin and scale to compute actual pixel positions.
- Author
- Wilfried Koch
- Copyright
- © 2025 Wilfried Koch. All rights reserved.