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.
Can #PB_2DDrawing_Outlined make all black lines?
- Random Terrain
- Posts: 63
- Joined: Fri Jul 09, 2021 9:48 pm
- Location: USA
- Contact:
Re: Can #PB_2DDrawing_Outlined make all black lines?
Please provide us with a small working code that demonstrates the behaviour.
- Random Terrain
- Posts: 63
- Joined: Fri Jul 09, 2021 9:48 pm
- Location: USA
- Contact:
Re: Can #PB_2DDrawing_Outlined make all black lines?
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()
https://www.randomterrain.com/bb-playfi ... basic_code
Thanks.
Re: Can #PB_2DDrawing_Outlined make all black lines?
I can't explain this effect, but it works when you don't put the drawing partly in the gadget event procedure:
Or like this, if #PB_2DDrawing_Outlined makes trouble:
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.
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()
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()
- Random Terrain
- Posts: 63
- Joined: Fri Jul 09, 2021 9:48 pm
- Location: USA
- Contact:
Re: Can #PB_2DDrawing_Outlined make all black lines?
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?
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?
Thanks for the screenshot, I can confirm this behaviour here. Looks like a bug to me. Wrote a bug report here.
- Random Terrain
- Posts: 63
- Joined: Fri Jul 09, 2021 9:48 pm
- Location: USA
- Contact: