QB64 Phoenix Edition
draw command curious behavior - Printable Version

+- QB64 Phoenix Edition (https://qb64phoenix.com/forum)
+-- Forum: QB64 Rising (https://qb64phoenix.com/forum/forumdisplay.php?fid=1)
+--- Forum: Code and Stuff (https://qb64phoenix.com/forum/forumdisplay.php?fid=3)
+---- Forum: Help Me! (https://qb64phoenix.com/forum/forumdisplay.php?fid=10)
+---- Thread: draw command curious behavior (/showthread.php?tid=724)



draw command curious behavior - James D Jarvis - 08-04-2022

I may have missed something somewhere in notes on rendering order because the behavior of the attached program surprised me.
I'm using the draw command to draw a simple shape as a sprite of sorts and it will overprint an image drawn with the other graphics commands but it will not overprint text. How the fill interacts is interesting as well. It just doesn't seem consistent with other drawing commands. 

Code: (Select All)
Screen _NewImage(800, 600, 256)
dd$ = "m+194,-40m+54,+89m-182,+35m-66,-84bm+134,+31 P12,15 c15"
Cls
_PrintMode _KeepBackground
For x = 0 To 300 Step 10
    _Limit 10
    Cls
    Line (100, 100)-(200, 200), 13, BF
    _PrintString (100, 100), "background image"
    Locate 11, 16: Print "XXX"
    dt$ = "c15 bm" + Str$(x) + ",100"
    Draw dt$
    Draw dd$
    _Display
Next



RE: draw command curious behavior - bplus - 08-04-2022

Interesting, does Draw have a Paint like command? How was that filled in?


RE: draw command curious behavior - Cobalt - 08-04-2022

I do believe that the DRAW command does have a paint feature. P I believe.

As for why it doesn't cover the text is because the text is the same color as the border color of the "object" so the fill treats it like more boarder.

if you insert a COLOR 14 in there so the text is yellow it will cover it.


RE: draw command curious behavior - James D Jarvis - 08-04-2022

(08-04-2022, 02:19 AM)bplus Wrote: Interesting, does Draw have a Paint like command? How was that filled in?

yup right there in the draw:  "bm+134,+31 P12,15 c15"    is a blind move 134pixels to the relative X and 31 pixels to the relative Y painted in color 12 with border 15 color 15 has to be declared again or the line will continue drawing with the fill color as the line color afterward if there were additional drawing commands.


RE: draw command curious behavior - James D Jarvis - 08-04-2022

(08-04-2022, 02:38 AM)Cobalt Wrote: As for why it doesn't cover the text is because the text is the same color as the border color of the "object" so the fill treats it like more boarder.

if you insert a COLOR 14 in there so the text is yellow it will cover it.

Well.... yup. I'm embarrassed. Sometimes it just takes someone else to point out the obvious I suppose.


RE: draw command curious behavior - TempodiBasic - 08-04-2022

Yes DRAW works like PAINT , it doesn't cover the bordercolor also if it is inner to  the area delimited by borders.

to avoid this disappointement you can DRAW filling the area with borders on another canvas (_NEWIMAGE) and then  paste by _PUTIMAGE it on the output screen.