@Fred
Someday will you have the chance to add the command:
ClearCanvasGadget(gadget, colour)
?
Thanks!
ClearCanvasGadget(gadget, colour)
- marcoagpinto
- Addict
- Posts: 947
- Joined: Sun Mar 10, 2013 3:01 pm
- Location: Portugal
- Contact:
Re: ClearCanvasGadget(gadget, colour)
What is wrong with
???
Code: Select all
Box(0, 0, OutputWidth(), OutputHeight(), Color)
Re: ClearCanvasGadget(gadget, colour)
He tried Box() and said it's too slow: viewtopic.php?f=13&t=72106
-
- Addict
- Posts: 1443
- Joined: Wed Nov 12, 2008 5:01 pm
- Location: Russia
Re: ClearCanvasGadget(gadget, colour)
Code: Select all
If OpenWindow(0, 0, 0, 400, 200, "VectorDrawing", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
CanvasGadget(0, 0, 0, 400, 200)
LoadFont(0, "Times New Roman", 20, #PB_Font_Bold)
If StartVectorDrawing(CanvasVectorOutput(0))
VectorFont(FontID(0), 150)
MovePathCursor(50, 25)
AddPathText("Text")
VectorSourceColor(RGBA(255, 0, 0, 255))
DashPath(3, 6)
StopVectorDrawing()
EndIf
SetGadgetColor(0, #PB_Gadget_BackColor, RGB(0, 250, 0)) ; <-- Clear CanvasGadget.
Repeat
Event = WaitWindowEvent()
Until Event = #PB_Event_CloseWindow
EndIf
Re: ClearCanvasGadget(gadget, colour)
I have posted something to this in the main thread:
viewtopic.php?p=542107#p542107
viewtopic.php?p=542107#p542107
sorry for my bad english
Re: ClearCanvasGadget(gadget, colour)
Josh, your snippet looks like a bug to report... EXCEPT that SetGadgetColor() doesn't officially support the CanvasGadget so it's not supposed to work.
That's what this feature request should be (no offense). Not a new, very specific command, but just add CanvasGadget support to either SetGadgetColor() or add a new #PB_Canvas_Color attribute to SetGadgetAttribute().
In the meantime, I just use the Box() method. For me it's fast enough for canvas GUIs even back to Windows XP. If you need high canvas framerates, you should use an accelerated Screen.
That's what this feature request should be (no offense). Not a new, very specific command, but just add CanvasGadget support to either SetGadgetColor() or add a new #PB_Canvas_Color attribute to SetGadgetAttribute().
In the meantime, I just use the Box() method. For me it's fast enough for canvas GUIs even back to Windows XP. If you need high canvas framerates, you should use an accelerated Screen.