As it happens, Not quite happy with AGK's draw system I decided to implement my own using GDI, drawing to an image, save out to temp and load back to agk as a sprite, automated within the plugin of course, I currently have basic shapes and images drawing with gradients... its looking ok IMO
IT IS NOT READY YET! BUT..........
I am making this plugin primarily for aiding me in UI development this is an example of what it can output so far ( a single image window frame with text and gradient fills)
^^ that window image is generated by the below code:
// create a 32 bit transparent image
img = draw.CreateImage( Image_NewID, width, height, Image_32BIT, Image_Transparent )
if draw.Start(img)
// draw the title bar
draw.SetMode(Draw_Mode_Gradient||Draw_Mode_AlphaBlend)
draw.SetFrontColor(fill_col)
draw.SetBackColor(frame_col)
draw.LinearGradient(width/2, 0, width/2, header_height)
draw.RoundBox( 0, 0, width, header_height, 5, 5, frame_col )
// draw the client area
draw.LinearGradient(width/2, header_height, width/2, height-header_height)
draw.RoundBox( 0, header_height, width, height, 5, 5, frame_col )
draw.SetMode(Draw_Mode_AlphaBlend||Draw_Mode_Outlined)
draw.RoundBox( 0, 0, width, height, 5, 5, frame_col )
// draw the seperator lines and fill the flat patch on the title bar
draw.Line( 0, header_height, width, 1, frame_col )
draw.LineXY( (210), 0, (190), header_height , frame_col)
draw.FillArea( 15, 15, frame_col, panel_fill_col)
// draw the test
str_title$="Some Text"
draw.SetFont(font)
w=draw.TextWidth(str_title$)
h=draw.TextHeight(str_title$)
draw.SetFrontColor(text_col)
draw.SetMode(Draw_Mode_AlphaBlend||Draw_Mode_Transparent)
draw.Text(20, (header_height/2)-(h/2), str_title$, -1, -1)
// finish drawing
draw.Stop()
// id for agk sprite
image_id=draw.GetImageID(img, Image_Transparent)
draw.FreeImage(img)
endif
Custom polygon shapes are being added and it already GetPixel/SetPixelColor functions,
if this is something the community would also like to use for a small fee then let me know I'll put a page up (yeah soz but I have to start charging for my plugins as work, pandemic... ya know, life's hard!)