Page 1 of 1
Can #PB_2DDrawing_Outlined make all black lines?
Posted: Tue Aug 17, 2021 3:09 am
by Random Terrain
If I use DrawingMode(#PB_2DDrawing_Outlined) and draw a black outline box on a canvas, the left line is black, the top line is black, but the right line is gray and the bottom line is gray.
Is there a way to have nothing but black lines on all four sides of a box when using PB_2DDrawing_Outlined?
Thanks.
Re: Can #PB_2DDrawing_Outlined make all black lines?
Posted: Tue Aug 17, 2021 6:57 am
by Peter
Please provide us with a small working code that demonstrates the behaviour.
Re: Can #PB_2DDrawing_Outlined make all black lines?
Posted: Tue Aug 17, 2021 9:16 am
by Random Terrain
Peter wrote: Tue Aug 17, 2021 6:57 am
Please provide us with a small working code that demonstrates the behaviour.
I cropped down the code the best I could, but when it's cropped, the only thing that is wrong is that the bottom line is thicker and right line is thicker. And for some strange reason the box only appears if you move the mouse pointer over the canvas area in the cropped version.
Code: Select all
Enumeration windows
#Window_Main
EndEnumeration
Enumeration gadgets
#Canvas_Playfield
EndEnumeration
Procedure GadgetEvents()
StartDrawing(CanvasOutput(#Canvas_Playfield))
DrawingMode(#PB_2DDrawing_Outlined)
Box(29, 31, 482, 354, #Black)
StopDrawing()
EndProcedure
Procedure initUI()
If OpenWindow(#Window_Main, 0, 0, 0, 0, "", #PB_Window_Background)
SetWindowColor(#Window_Main, #White)
CanvasGadget(#Canvas_Playfield, 40, 40, 542, 417, #PB_Canvas_Border | #PB_Canvas_Keyboard)
EndIf
EndProcedure
initUI()
BindEvent(#PB_Event_Gadget, @GadgetEvents())
StartDrawing(CanvasOutput(#Canvas_Playfield))
Box(0, 0, 542, 417, $E9EAEA)
StopDrawing()
If I use DrawingMode(#PB_2DDrawing_Outlined) in this program, I get those gray lines:
https://www.randomterrain.com/bb-playfi ... basic_code
Thanks.
Re: Can #PB_2DDrawing_Outlined make all black lines?
Posted: Tue Aug 17, 2021 6:58 pm
by munfraid
I can't explain this effect, but it works when you don't put the drawing partly in the gadget event procedure:
Code: Select all
EnableExplicit
Enumeration windows
#Window_Main
EndEnumeration
Enumeration gadgets
#Canvas_Playfield
EndEnumeration
Procedure initUI()
If OpenWindow(#Window_Main, 0, 0, 0, 0, "", #PB_Window_Background)
SetWindowColor(#Window_Main, #White)
CanvasGadget(#Canvas_Playfield, 40, 40, 542, 417, #PB_Canvas_Border | #PB_Canvas_Keyboard)
StartDrawing(CanvasOutput(#Canvas_Playfield))
Box(0, 0, 542, 417, $E9EAEA)
DrawingMode(#PB_2DDrawing_Outlined)
Box(29, 31, 482, 354, #Black)
StopDrawing()
EndIf
EndProcedure
initUI()
Or like this, if #PB_2DDrawing_Outlined makes trouble:
Code: Select all
EnableExplicit
Enumeration windows
#Window_Main
EndEnumeration
Enumeration gadgets
#Canvas_Playfield
EndEnumeration
Procedure initUI()
If OpenWindow(#Window_Main, 0, 0, 0, 0, "", #PB_Window_Background)
SetWindowColor(#Window_Main, #White)
CanvasGadget(#Canvas_Playfield, 40, 40, 542, 417, #PB_Canvas_Border | #PB_Canvas_Keyboard)
StartDrawing(CanvasOutput(#Canvas_Playfield))
Box(0, 0, 542, 417, $E9EAEA)
Box(29, 31, 482, 354, #Black)
Box(30, 32, 480, 352, $E9EAEA)
StopDrawing()
EndIf
EndProcedure
initUI()
Your editor has been growing wild and needs some serious workover. Especially the entire drawing needs to be redone and put inside a dedicated procedure. Still very busy, but I'll have a look.
Re: Can #PB_2DDrawing_Outlined make all black lines?
Posted: Wed Aug 18, 2021 12:51 am
by Random Terrain
munfraid wrote: Tue Aug 17, 2021 6:58 pm
I can't explain this effect, but it works when you don't put the drawing partly in the gadget event procedure:
Thanks. When I run your DrawingMode(#PB_2DDrawing_Outlined) example and take a screenshot and zoom in, those thick gray lines are there on the right and bottom instead of thin black lines.
It's as if it's trying to do some kind of fancy effect when you just want thin black lines. I gave up on it and used normal filled in boxes, but it would be nice to be able to use PB_2DDrawing_Outlined in a future online tool if it will ever work properly. In CSS, you can define the thickness of a line and have total control over the look of it. I guess JavaScript doesn't allow that?
munfraid wrote: Tue Aug 17, 2021 6:58 pm
Your editor has been growing wild and needs some serious workover. Especially the entire drawing needs to be redone and put inside a dedicated procedure. Still very busy, but I'll have a look.
Yep, since I'm still trying to learn, I'm not exactly sure how to make it less wild yet. I was lucky to get the new code working properly. There are special weird modes that can be done on the Atari 2600 using batari Basic and it felt like jumping through flaming hoops to get them to look the way they do using Stella (Atari 2600 emulator). The last mode I added has a mirrored playfield. If you select one of the multisprite kernel modes and draw on the playfield, you'll be drawing in two places at the same time. Besides trying to figure out math that almost broke my brain, the multisprite kernel can only have one foreground color and one background color, so I had to make sure that was working correctly too.
Thanks.
Re: Can #PB_2DDrawing_Outlined make all black lines?
Posted: Wed Aug 18, 2021 10:47 am
by munfraid
Thanks for the screenshot, I can confirm this behaviour here. Looks like a bug to me. Wrote a bug report
here.
Re: Can #PB_2DDrawing_Outlined make all black lines?
Posted: Wed Aug 18, 2021 3:10 pm
by Random Terrain
munfraid wrote: Wed Aug 18, 2021 10:47 am
Thanks for the screenshot, I can confirm this behaviour here. Looks like a bug to me. Wrote a bug report
here.
Thanks.