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:
 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.
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement