Re: A86: String Centering Routine?


[Prev][Next][Index][Thread]

Re: A86: String Centering Routine?




you want to center horizontally?
well, first you need to get the width of the string (you're using the
small font, right?)
one way of doing that is to call up the width of each char and add them. 
if you're not using the graph buffer, though, try this:

;hl->string
;returns: a=width
string_width:
	xor a
	ld (_penCol),a
	res textwrite,(iy+new_grf_flgs)	;don't draw to lcd
	call _vputs
	ld a,(_penCol)
	set textwrite,(iy+new_grf_flgs)
	ret

then subtract the width of the string from the screen width and divide by
two
	ld b,-128
	add a,b
	sra a
that's the column to start in

now all you have to do is find the corresponding flag for the 83!

-josh

On Sat, 19 Dec 1998 14:39:20 EST Jkhum98@aol.com writes:
>
>Hey, can somebody post a reply that includes the routine for Centering 
>a
>String on the Screen...?  I can't seem to find it anywhere... :\  I 
>need to
>use it for the 83, how hard would it be to port (I'd do this myself 
>though)
>but is it just screen dimensions I need to change...? Thanks... =)
>																--Jason 
>K.
>

___________________________________________________________________
You don't need to buy Internet access to use free Internet e-mail.
Get completely free e-mail from Juno at http://www.juno.com/getjuno.html
or call Juno at (800) 654-JUNO [654-5866]