I'm drawing a textbox, and I'm wondering what is the most efficient order of drawing the lines. The reason I'm drawing it line by line is because it needs to be of arbitrary size and location.
given: coordinates for corners (shadows within coordinates)
bc=top left
de=bottom right
Current order: (you'll know what I mean when you look at the picture)
left
right
right shadow
top
bottom
bottom shadow
ex. code:
Code:
don't worry what line does for now, just know that it draws a line with coordinates bc-de, with (0,0) being top left.
given: coordinates for corners (shadows within coordinates)
bc=top left
de=bottom right
Current order: (you'll know what I mean when you look at the picture)
left
right
right shadow
top
bottom
bottom shadow
ex. code:
Code:
push bc ;save coordinates
push de
;left
inc c ;"rounded" edge
dec e
dec e ;for the shadow
ld d,b
call line
;right
pop de
push de
ld b,d
dec e
call line
;right shadow
inc b ;shift over
inc d
inc c
dec e
call line
;top
pop af
pop bc
push bc
push af
inc b
ld e,c
dec d
dec d
call line
;bottom
pop de
dec d
dec e
ld c,e
call line
;bottom shadow
inc b
inc c
inc e
call line
don't worry what line does for now, just know that it draws a line with coordinates bc-de, with (0,0) being top left.