mirror of
https://github.com/boxgaming/qbjs.git
synced 2024-05-12 08:00:12 +00:00
Page:
G2D.Shadow
Pages
Adding Support for a New Keyword
Console.Echo
Console.Log
Console.LogLevel
Dom.Add
Dom.Alert
Dom.Confirm
Dom.Container
Dom.Create
Dom.Event
Dom.Get
Dom.GetImage
Dom.Prompt
Dom.Remove
Export
FS.DownloadFile
FS.ListDirectory
FS.UploadFile
G2D.Bezier
G2D.Curve
G2D.Ellipse
G2D.FillCircle
G2D.FillEllipse
G2D.FillRoundRect
G2D.FillTriangle
G2D.InvertRect
G2D.LineCap
G2D.LineDash
G2D.LineDashOff
G2D.LineWidth
G2D.RotoZoom
G2D.RoundRect
G2D.SaveImage
G2D.Shadow
G2D.ShadowOff
G2D.Triangle
Home
Import
QBasic Language Support
Roadmap
Samples
Storage.Clear
Storage.Get
Storage.Key
Storage.Length
Storage.Remove
Storage.Set
Supported Keywords
Unsupported Keywords
2
G2D.Shadow
boxgaming edited this page 2023-09-29 11:14:16 -05:00
Table of Contents
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