I use the Path functionality to define a shape (a hexagon) and then use ClipPath to assign a bitmap to the defined path (to create a textured look. Is it possible to use the created shape as a discrete object that can be rotated, flipped and moved about the screen? In other words, create that hexagon at some point on the screen at run time and then move it to another location as an animation.
Thanks in advance
I suggest you to use a transparent ImageView or Panel, draw the hexagon onto it and then you can move and rotate it, rotation will need the Reflection library.
Or you could use a transparent Panel covering the whole screen and draw the hexagone where you want, to erase the previous hexagon draw a transparent one at it's position.
Hi Klaus, I'vve had a look at the reflection library but don't know which methods to use. The code below draws (on Panel1 with PanelCanvas on it) the shape previously defined by XPath1 and puts the texture Xsurface on it. How do I then rotate the panel by 60 degrees and move it from X1,Y1 to X2Y2? Thanks
Hi, I developed a work around for my last post above (#4) using the AnimationPlus libary as below. In terms of resources, is this more expensive than using the Reflection library. I'd appreciate it if anyone can advise and also provide the reflection code to achieve the rotation. Thanks in advance.
B4X:
Dim ani as AnimationPlus
ani.InitializeRotatecenter("ani",0,45, Panel1)
'ani.Duration=2000 if the duration isn't set then the animation is instantaneous
ani.Start(Panel1)
ani.PersistAfter=True
'Sets the rotation angle of the given view
Sub setRotation(v As View, a As Float)
refl.Target = v
refl.RunMethod2("setRotation", a, "java.lang.float")
End Sub