B4A Library [B4X][XUI] AnimatedArrow - focus the user attention

Erel

Administrator
Staff member
Licensed User


Usage:
- Declare and initialize an AnimatedArrow object.
- Call Show with the parent, target point and angle.

Each object should be used once.

It is compatible with B4A, B4i and B4J.
Make sure to use the latest versions of XUI library.
The number of steps is reduced in debug mode.

The class is inside the B4J project.
 

Attachments

Last edited:

Erel

Administrator
Staff member
Licensed User
There is a useful method inside the class called DrawLineAnimated. It can be used to make all kinds of animated drawings.

For example (the animation looks better in the real program):

house.gif

Relevant code:
B4X:
Public Sub DrawHouse (Parent As B4XView, TargetX As Float, TargetY As Float, VisibleDuration As Int)
   Parent.AddView(base, TargetX, TargetY, base.Width, base.Height)
   cvs.ClearRect(cvs.TargetRect)
   Dim duration As Int = 300
   DrawLineAnimated(duration, 20, 10dip, 100dip, 110dip, 100dip, True)
   Sleep(duration)
   DrawLineAnimated(duration, 20, 110dip, 100dip, 110dip, 200dip, True)
   Sleep(duration)
   DrawLineAnimated(duration, 20, 110dip, 200dip, 10dip, 200dip, True)
   Sleep(duration)
   DrawLineAnimated(duration, 20, 10dip, 200dip, 10dip, 100dip, True)
   Sleep(duration)
   DrawLineAnimated(duration, 20, 10dip, 100dip, 110dip, 200dip, False) 'It will be invalidated in the next line
   DrawLineAnimated(duration, 20, 110dip, 100dip, 10dip, 200dip, True)
   Sleep(duration)
   DrawLineAnimated(duration, 20, 10dip, 100dip, 60dip, 50dip, False)
   DrawLineAnimated(duration, 20, 110dip, 100dip, 60dip, 50dip, True)
   Sleep(duration)
   Sleep(VisibleDuration)
   base.SetVisibleAnimated(100, False)
   Sleep(100)
   base.RemoveViewFromParent
   cvs.Release
End Sub
(The base size is set to 400dip x 400dip)
 
Top