B4J Question Drawing on top of views

Daren463

Member
Licensed User
Longtime User
I am trying to draw lines over several different custom views. When the line is drawn it is drawn under the views. Is there a way to send the custom views to the back or an option to draw on top of the custom views?
 

Daren463

Member
Licensed User
Longtime User
1629192219586.png


After the custom views are added I try and draw a line. In this example the green line starts a 0,0 of the pane and continues under the custom views to the other side. The custom views are on the same pane the canvas was initialized with.

B4X:
Public Sub CreateNewMap
    Dim height As Int
    Dim width As Int
    Dim sqrCount As Int
    height = 7
    width = 7
    sqrCount = 0
    For column = 1 To 7
        For row = 1 To 7
            Msquare(sqrCount).Initialize(Me,"")
            pnlMap.AddNode(Msquare(sqrCount).GetBase,100* row,100 * column,1,1)
            Msquare(sqrCount).SetPOSx(column)
            Msquare(sqrCount).SetPOSy(row)
            Msquare(sqrCount).HighLightSqr(False)
            
            AddNewTile(sqrCount, column, row)
            sqrCount = sqrCount + 1
        Next
        
    Next
    
    

End Sub


Private Sub DrawLOS(p1 As point , p2 As point)

    cv.Initialize(pnlMap)
    cv.DrawLine(0, 0, 5000, 5000, xui.Color_Green, 2dip)
    
End Sub
 
Upvote 0

Daren463

Member
Licensed User
Longtime User
Initializing there was the last thing I tried in a long list.

1629260583983.png

I tried your suggestion. The canvas was initialized to the red pane which is on top of the black pane (set in the designer) in which the custom views are nodes. The custom views appear to be above everything....?
 
Last edited:
Upvote 0
Top