Create arrow/lines in Preview Mode?

newbie-question

#1

Hey guys,

I want to make it where a widget on a map can be clicked to create a line (path) between the widget and wherever the user clicks afterwards. It would just be two widgets on the page, a “character” (widget) and the map (widget). I haven’t figured out the arrows so I don’t have anything to show. I don’t want to have a million hidden lines either, just an interactive line created when the “character” is clicked.

Any help is greatly appreciated!!


#2

Hi Drag737,

If I’m understanding correctly, you’d like to create a function that draws a line between a two widgets that a user clicks. If that’s the case, the example posted here may help what you’re looking to do:

https://www.axure.com/c/forum/advanced-prototyping/21288-connect-two-rectangles-straight-line.html#post67992

In this example, josephxbrick uses a repeater widget to store the various x and y values of the different widgets, and then a “OnItemLoad” interaction to size and rotate the lines depending on which widgets are clicked by the user. Please note that this implementation is fairly complex, involving the use of a repeater widget as well as some conditional logic and mathematical expressions. If you’re not yet familiar with these concepts in Axure RP, I’d recommend reading more about them on our support page:

Axure | Repeater Widgets

Axure | Conditional Logic

Axure | Math, Functions, and Expressions

Hopefully this helps! Please let me know if you have any questions or if this wasn’t quite what you were looking for.


#3

Hi!
It was not quite what I’m looking for. In mine, I want to have a map, and a very small box over the large map image. When you click on the small box, then anywhere on the map, I want a line to appear where those two points were. So no matter what, the line needs to appear connected to the small box, but depending on where the user clicks, one end of the line “moves” to where the user clicked the second time. Sort of like a GPS, but without all of the additional planning and routing around items.


#4

Here is a short tutorial for the topic: How to create a Line Draw function in Axure with some math and trigonometry


#5

Why was this archived? I want to know about this specific topic that you’ve posted and you’ve shared it on various posts. Do you have an example axure file of this?


closed #6