Glimmr Canvas-Based Drawing

version 2/101030 by Erik Temple

  • Home page
  • Beginning
  • Previous
  • Next

  • Chapter - Rendered strings

    Section - Rendered string base class

    A rendered string is a kind of g-element.

    The specification of rendered string is "A rendered string is a graphic element that renders an indexed text string--the 'text string' property--graphically. A rendered string must have an 'associated font' specified in order to function. Rendered strings can be left-aligned (the default), center-aligned, or right-aligned; the alignment refers to whether the origin will be the upper left, the upper center point, or the upper right of the rendered text. A cursor position can be specified (the 'cursor' property); this is a number that represents the position after which the cursor will be placed."

    A rendered string has a font called the associated font.

    [A rendered string can also have a cursor, which allows us to use rendered strings with input. The cursor is initially set to -99; this or any other negative number will suppress display of the cursor. A cursor value of 0 or higher will place the cursor after that character in the string. In other words, a cursor value of 2 places the cursor after the second character in the string. A cursor value greater than the number of characters in the string will never be shown.]

    A rendered string has a number called the cursor. The cursor is usually -99.

    [Center and right alignment in rendered strings function differently from other g-elements; the vertical positioning does not change. This mimics the behavior of alignment in word processors, as is more appropriate for text.]
    A rendered string is usually left-aligned.

    [A rendered string is rendered either by providing a text string or a list of numbers, which represents a list of the characters of the string. The latter is faster, but more work for the author.]
    A rendered string has an indexed text called the text-string. The text-string of a rendered string is "".

    A rendered string has a glulx color value called the tint. The tint of a rendered string is g-White.
    A rendered string has a glulx color value called the background tint. The background tint of a rendered string is g-PlaceNullCol.