This commit is contained in:
2025-02-18 23:13:50 -05:00
parent 73ef647156
commit 116c2e2e2f
4 changed files with 16 additions and 15 deletions

View File

@@ -142,10 +142,7 @@ namespace JUI {
void AnchorPoint(const Vector2 &point);
///
Tween* TweenAnchorPoint(const Vector2& goal, TweenInfo info = {})
{
}
Tween* TweenAnchorPoint(const Vector2& goal, TweenInfo info = {});
#pragma region Padding
/// Returns the padding factor on the left of this widget.

View File

@@ -40,14 +40,17 @@ namespace JUI {
void MoveCursorRight();
unsigned int CursorMaxPosition() const;
/// Returns the maximum position of the cursor, which is determined by the input buffer's length.
[[nodiscard]] unsigned int CursorMaxPosition() const;
void SetCursorPosition(unsigned int pos);
/// Fires the input event, clears the input buffer, and sets the state to be ready for further input.
void SendInput(bool clear_input);
/// Copy the contents of the input form, or the selection if active, into the the system's clipboard.
void Copy();
/// Paste the contents of the system's clipboard
void Paste();
void Cut();

View File

@@ -350,14 +350,7 @@ void inspect_widget(JUI::Widget* w, int depth = 1) {
}
}
int main()
{
for (float i = 0; i < 1; i += 0.01f)
{
std::cout << JUI::EasingFunctions::EaseInSine(i) << std::endl;
}
int main() {
using namespace ReWindow;
// TODO: Find out new jlog api for silencing specific loggers.

View File

@@ -584,4 +584,12 @@ Tween* Widget::TweenMarginBottom(const JUI::UDim& goal, JUI::TweenInfo info) {
Tween* t = new Tween(updateTillGoalReached, info);
tweens.push_back(t);
return t;
}
}
Tween *Widget::TweenAnchorPoint(const Vector2 &goal, TweenInfo info) {
Vector2 start = this->AnchorPoint();
TweenTickFunc updateTillGoalReached = [this, start, goal] (float elapsed, float progress) mutable {
Vector2 step = start.Lerp(goal, progress);
AnchorPoint(start);
};
}