Hi there,
when creating an include for drawing of specific elements, sometimes it's needed to set the DrawingMode (for example for Texts-Entries).
Including a Procedure of such an include might take effect on the behavior of the main sourcecode.
This means, that I might want to draw some PureBasic specific elements like text, than call a function to draw for example a star and than draw some text again.
When changing the drawingmode inside the "DrawStar"-Procedure, I'm unable to restore the old DrawingMode.
So, when adding a function "GetDrawingMode", I could save the old drawing mode, set my drawing mode, draw my elements and restore the old drawingmode before Returning from the procedure.
A second possibility would be to make DrawingMode return the old drawingmode.
Please check and implement that, it should not be that much work.
Thank you and best Regards
Franky
GetDrawingMode or ReturnValue for DrawingMode
GetDrawingMode or ReturnValue for DrawingMode
Give Up everything but trying!
Re: GetDrawingMode or ReturnValue for DrawingMode
+1
Good request for writing modular drawing functions. Glad I searched before posting...
I wish DrawingMode() returned the previous mode, similar to UseGadgetList() so we can write:
In fact, FrontColor() and BackColor() could return the previous values too!
Good request for writing modular drawing functions. Glad I searched before posting...
I wish DrawingMode() returned the previous mode, similar to UseGadgetList() so we can write:
Code: Select all
Procedure DrawMyObject()
PrevMode = DrawingMode(#PB_2DDrawing_AlphaBlend)
; draw something here
DrawingMode(#PB_2DDrawing_Gradient)
; draw something here
DrawingMode(#PB_2DDrawing_Transparent)
; draw something here
; restore drawing mode
DrawingMode(PrevMode)
EndProcedure
- DoubleDutch
- Addict
- Posts: 3220
- Joined: Thu Aug 07, 2003 7:01 pm
- Location: United Kingdom
- Contact:
Re: GetDrawingMode or ReturnValue for DrawingMode
Good idea.
https://deluxepixel.com <- My Business website
https://reportcomplete.com <- School end of term reports system
https://reportcomplete.com <- School end of term reports system
Re: GetDrawingMode or ReturnValue for DrawingMode
+1 ! This is a really enhancement.