1
1
Fork 0
mirror of https://github.com/boxgaming/qbjs.git synced 2024-05-12 08:00:12 +00:00
2 G2D.Shadow
boxgaming edited this page 2023-09-29 11:14:16 -05:00

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.

Syntax

G2D.Shadow clr~&, offsetX&, offsetY&, blurRadius&

Parameters

  • 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.

Examples

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

See Also

G2D.ShadowOff