HOME
EDIT ITEM
CMM2 LIBRARY
by
Subtitle
Version
Description
Simple library for use standard fonts on CMM2 as proportional ones. Started with version 0.02, you can mix standard (monospaced) PRINT and TEXT commands with proportional from this library. This library can be used for example in text adventures, because of better readability of texts... [b]Usage:[/b] [o] [i]initAll.PROP[/i] initialise offsets and widths for all built-in fonts [o] [i]initFont.PROP(fnt%)[/i] initialise offsets and widths for font fnt% [o] [i]text.PROP(x%,y%,txt$,al%,fnt%,fc%,bc%)[/i] similar to TEXT command, just size parameter is ommited [o] [i]print.PROP(txt$, addSpace$)[/i] prints proportional txt$ on current position, wraps character to next line, without line feed, if the string addSpace$ is not empty, then to Nth SPACE (" ") in txt$ is added PX pixels, where PX=ASC(MID$(addSpace$, N, 1)), you can use TAB and LF chars in txt$ [o] [i]printLn.PROP(txt$, addSpace$)[/i] same as print.PROP with line feed [o] [i]wrap.PROP(txt$)[/i] word wrapped proportional text output [o] [i]justify.PROP(txt$, txtWidth%, dx%)[/i] full jutified left and right word wrapped proportional text with size txtWidth% written to offset dx% [o] [i]justifyLine.PROP(txt$, txtWidth%, dx%)[/i] full jutified ONE LINE left and right word wrapped proportional text with size txtWidth% written to offset dx%. In txt$ is then returned non printed rest of text [o] [i]getTextWidth.PROP(fnt$, txt$)[/i] returns width of the proportinal text in font fnt% in pixels [o] [i]tab.PROP(t%)[/i] will set TAB position to every t%-pixels [o] [i]font.PROP(f%)[/i] will set FONT [o] [i]color.PROP(fc%, bc%)[/i] set foreground and background color
Download