Widget text and shadows

Has anyone successfully used widgetText shadows? If so, can you point me to examples?

I can’t get them to work properly, but I’m guessing it has more to do with my lousy javascript than any bugs.

widget.backgroundColor = new Color("FFFFFF")
let titleTxt = widget.addText("Hello World")
titleTxt.font = Font.boldSystemFont(12)
titleTxt.textColor = Color.white()
titleTxt.shadowColor = Color.black()
titleTxt.shadowOffset = new Point(1,1)
titleTxt.shadowRadius = 1

Set the background color completely white and the text color as well for testing and then you can play with the offsets and radius. Don’t set the values too high. I‘m using 0.5 for each.


Wonderful. Thanks! Couldn’t figure out what numbers made sense.

I’m trying to figure out if I can use it to antialias text against an image, but so far no luck. That is, I can get a white drop-shadow effect but it doesn’t make the text much clearer. Will keep tinkering.

Super… this the result on my dateimage