it should work according this side, checked on Chrome https://www.w3schools.com/tags/tryit.asp?filename=tryhtml5_canvas_createradialgradient
however on Chrome i see this:
all other painting is gone.
removing thie StrokeStyleRadialGradient line solved the problem. But then the gradient is missing.
Could this be a bug in ABM ?(i know unthinkable, but just the question
)
used code:
however on Chrome i see this:

all other painting is gone.
removing thie StrokeStyleRadialGradient line solved the problem. But then the gradient is missing.
Could this be a bug in ABM ?(i know unthinkable, but just the question
used code:
B4X:
Radius = Radius * 0.9
Dim angle=(180-alfa)*cPI/180 As Double
' // draw face
compas.translate(Radius,Radius)
compas.beginPath
compas.arc(0,0,Radius, 0, 2*cPI)
compas.fillStyleColor("#0000ff")
' compas.strokeStyleRadialGradient(0,0,Radius*0.95,0,0,Radius*1.05, Array As Double(0,0.5,1), Array As String("#333", "white", "#7733"))
compas.fill
compas.lineWidth(Radius*0.1)
compas.stroke
' 'draw needle
compas.rotate(-angle) 'rotate first the picture
compas.beginPath
compas.lineWidth(1)
compas.moveTo(-10,0)
compas.lineTo(0,Radius*0.65)
compas.lineTo(0,0)
compas.lineTo(-10,0)
compas.fillStyleColor("#ffff00")
compas.fill
'
compas.beginPath
compas.moveTo(10,0)
compas.lineTo(0,Radius*0.65)
compas.lineTo(0,0)
compas.lineTo(10,0)
compas.fillStyleColor("#ff0000")
compas.fill
'
compas.rotate(angle) 'then rotate the picture back. The needle will be moved, the dial is back on its place
'
compas.fillStyleColor("#ffffff")
compas.font("arial", Radius*0.10)
compas.textBaseline(ABM.CANVAS_TEXTBASELINE_MIDDLE)
compas.textAlign(ABM.CANVAS_TEXTALIGN_CENTER)
Dim const Bearing() As String=Array As String ("N","NNW","NW","WNW","W","WZW","ZW","ZZW","Z","ZOZ","ZO","OZO","O","ONO","NO","NNO")
Dim ang As Double
For num = 0 To 15
ang = -num * cPI / 8
compas.rotate(ang)
compas.translate(0, -Radius*0.75)
compas.rotate(-ang)
compas.fillText("" & Bearing(num), 0, 0)
compas.rotate(ang)
compas.translate(0, Radius*0.75)
compas.rotate(-ang)
Next
'draw center
compas.beginPath
compas.fillStyleColor("#ffff00")
compas.arc(0,0,Radius*0.1,0,2*cPI)
compas.fill
'draw wind (knts)
compas.fillStyleColor("#ffff00")
compas.fillText(knts&" knts",0,Radius*0.5)