Simple drawing that fades to background.
#1
Started playing with a smooth drawing routine and a screen fading method.  Curious as to what could become of using this method.  

- Dav

Code: (Select All)
'Simple drawing that fades to background.
'Coded by Dav, NOV/2022

SCREEN _NEWIMAGE(1000, 800, 32)

DO
    WHILE _MOUSEINPUT: WEND
    mx = _MOUSEX: my = _MOUSEY
    mb1 = _MOUSEBUTTON(1)
    IF mb1 THEN
        IF stilldown = 1 THEN
            stepx = lastmx - mx
            stepy = lastmy - my
            length = INT((stepx ^ 2 + stepy ^ 2) ^ .5)
            dx = stepx / length
            dy = stepy / length
            FOR i = 0 TO length
                FOR d = 1 TO size%
                    CIRCLE (mx + dx * i, my + dy * i), d, clr&
                NEXT
            NEXT
        ELSE
            size% = RND * 20 + 5                         '<=== brush size
            clr& = _RGB(RND * 255, RND * 255, RND * 255) '<=== brush color
            FOR d = 1 TO size% STEP .2
                CIRCLE (mx, my), d, clr&
            NEXT
        END IF
        lastmx = mx: lastmy = my
        stilldown = 1
    ELSE
        stilldown = 0
    END IF
    LINE (0, 0)-(_WIDTH, _HEIGHT), _RGBA(32, 32, 32, 32), BF
    _DISPLAY
    _LIMIT 30
LOOP

Find my programs here in Dav's QB64 Corner
Reply


Messages In This Thread
Simple drawing that fades to background. - by Dav - 11-04-2022, 10:27 PM



Users browsing this thread: 4 Guest(s)