Announcement

Collapse
No announcement yet.

Moving a label on the page

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Moving a label on the page

    I created these Functions to move a label:

    Code:
    function Forward(labelName)
        local currentPos = Label.GetPos(labelName);
        local newPos = currentPos.X + 10;
        for lab = currentPos.X, newPos, 0.150 do
         Label.SetPos(labelName, lab, currentPos.Y);
        end
    end
    
    function Backward(labelName)
        local currentPos = Label.GetPos(labelName);
        local newPos = currentPos.X - 10;
        for lab = currentPos.X, newPos, -0.150 do
         Label.SetPos(labelName, lab, currentPos.Y);
        end
    end
    and it works fine but sometimes when cursor moves outside the project it is not working properly.

    Is there a solution or a better way to do it ?
Working...
X