Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Is there a faster way to do this glow circle effect?
#1
Trying to make a glow/spotlight effect where only the circle area of the screen where the mouse is at shows.  This works but it lags pretty bad on my laptop.  The circle draws are the slow down.  Is there a better way to do this effect?  I remember someone at the old forum posted an effect like this, but I forget who it was.

- Dav

Code: (Select All)

Screen _NewImage(1000, 700, 32)

'draw a background
For x = 0 To _Width Step 25
    For y = 0 To _Height Step 25
        Line (x, y)-Step(25, 25), _RGBA(Rnd * 255, Rnd * 255, Rnd * 255, 150), BF
    Next
Next

'copy screen as image
back& = _CopyImage(_Display)

Do

    'get mouse input
    While _MouseInput: Wend
    mx = _MouseX: my = _MouseY

    'place background first
    _PutImage (0, 0), back&

    'draw fadeout circle where mouse x/y is
    For x = 0 To _Height * 2 Step .333
        Circle (mx, my), x, _RGBA(0, 0, 0, x / 1.9)
    Next

    _Display
    _Limit 30

Loop Until InKey$ <> ""

Find my programs here in Dav's QB64 Corner
Reply


Messages In This Thread
Is there a faster way to do this glow circle effect? - by Dav - 06-16-2024, 01:13 PM



Users browsing this thread: 10 Guest(s)