Skip to content
ben-mkiv edited this page Feb 14, 2019 · 2 revisions

2D Overlay Widget

Box2D

widget = component.glasses.addBox2D();
-- adds a gradient Box to the 2D Overlay
-- add 2 color modifiers to specify the color

Example

-- draw a rectangle box with a gradient from opaque red to translucent green
glasses = require("component").glasses
widget = glasses.addBox2D();
widget.setSize(100, 20)
widget.addTranslation(50, 50)
widget.addColor(1, 0, 0, 1)
widget.addColor(0, 1, 0, 0.5)

methods