PathTool class
#include <Jazz2/Editor/Tools/PathTool.h>
Places the event to place along a path, at even distances — a row or an arc of coins or gems.
Each click adds a point of the path, with Ctrl in the middle of a tile. The path goes straight from point to point, or in a smooth curve through them. The events are shown where they'll be, the right button places them, as one step that can be undone. They're placed off the grid, exactly on the path, or on the tiles the path goes through. The options of the tool set the distance between them.
Base classes
- class EditorTool
- Tool used in the view of the level editor.
Public types
- struct Options
- How the events are placed.
Public static functions
- static void GetLine(ArrayView<const Vector2f> points, bool smooth, SmallVectorImpl<Vector2f>& line)
- Returns a path as a fine line, straight from point to point or a smooth curve through them.
- static void GetPlacements(ArrayView<const Vector2f> points, bool smooth, float spacing, SmallVectorImpl<Vector2f>& placements)
- Returns where events go along a path, at even distances from its first point.
Constructors, destructors, conversion operators
Public functions
- auto GetType() const -> EditorToolType override
- Returns the type.
- void OnDeactivate() override
- Called when another tool is chosen, anything in progress is cancelled.
- void OnPointerDown(const ToolPointer& pointer) override
- Called when the pointer is pressed over the view.
- void Cancel() override
- Cancels what the tool is doing.
- auto IsBusy() const -> bool override
- Returns
trueif the tool is in the middle of something. - auto HasPointerCapture() const -> bool override
- Returns
trueif the tool follows the pointer pressed, another tool can't be taken for a while then. - void DrawOverlay(Painter& painter, const ToolPointer& hover, bool hoverValid) override
- Draws what the tool shows over the view.
- auto GetHint() const -> StringView override
- Returns a hint of how the tool is used.
- void BuildOptions(ToolOptionsBuilder& builder) override
- Makes the options of the tool shown in the toolbar while it's chosen, none by default.
Function documentation
bool Jazz2:: Editor:: PathTool:: HasPointerCapture() const override
Returns true if the tool follows the pointer pressed, another tool can't be taken for a while then.
A tool in the middle of something clicked point by point, as a path, doesn't, the hand can move the view between the clicks. It's IsBusy() by default.