-
Notifications
You must be signed in to change notification settings - Fork 10
G2D.Shadow
boxgaming edited this page Sep 29, 2023
·
2 revisions
Applies a shadow effect to subsequent drawing methods. This effect will be applied to any other 2d library drawing methods as well as any standard QBasic/QB4 drawing methods. This will also be applied to text drawing methods (e.g. Print, _PrintString). For text drawing, the shadow effect works best combination with the _KeepBackground print mode.
G2D.Shadow clr~&, offsetX&, offsetY&, blurRadius&
- The clr~& parameter defines the color of the shadow.
- The offsetX& and offsetY& parameters specify the amount by which the shadow is offset from the drawn item.
- The blurRadius& parameter specifies the amount of blur to apply to the shadow effect.
Example1: Apply a drop shadow to a square and text.
Import G2D From "lib/graphics/2d.bas"
Cls , 15
G2D.Shadow 0, 7, 7, 5
Line (100, 100)-(200, 200), 2, BF
Dim fnt As _Unsigned Long
_PrintMode _KeepBackground
fnt = _LoadFont("sans-serif", 30)
_Font fnt
Color 0
G2D.Shadow 0, 5, 5, 5
_PrintString (275, 200), "This is a string!"
Example2: Apply a glow effect to a circle
Import G2D From "lib/graphics/2d.bas"
G2D.Shadow 14, 0, 0, 7
Circle (200, 200), 100, 2