Make an image go the mouse X position

Hi, this is my first time using Defold and I am trying to make a game where the player moves a character by moving their mouse of finger left and right. how would I do this?

Here are some moment based examples: