VgaGames4 - dialog man-pages

[.. upper level ..]

vg4->dialog->text()

Open a canvas-dialog for showing a text.

SYNTAX
VG_BOOL vg4->dialog->text(const char *fsize, const char *cvasdir, const struct VG_Position *posdst, struct VG_Hash *hvar)

FUNCTION PARAMETERS
fsize Which canvas-file: "small", "medium" or "large"
cvasdir Directory to load canvasses from, or NULL = use system-canvasses
posdst Canvas-position on window, or NULL = centered
hvar Hash with variable-values (see vg4->canvas->load())

RETURN VALUE
Returns boolean: - VG_TRUE: OK - VG_FALSE: Got exit-request

DESCRIPTION
Open a canvas-dialog for showing a text. This function uses following canvas-file (installed below share/vgagames4/canvas/) - text.small.cvas: Top-canvas (small size) - text.medium.cvas: Top-canvas (medium size) - text.large.cvas: Top-canvas (large size) The parameter hvar should contain following variables - key: top:title value: title of canvas - key: top:text value: the text - key: top:velo value: moving velocitas in pixels - key: top:font value: default font, e.g. sys:low - key: top:fgcolor value: text color, e.g. 0xff0000 If own canvas-files shall be used instead of the system-canvas-files, they must lay in cvasdir or cvasdir/text/ and have the same names as the system-canvas-files: - text.small.cvas (small size) text.medium.cvas (medium size) text.large.cvas (large size) - uses canvas-items: - [CV-TEXT] with name title: text for title - [CV-TEXT] with name text: the text - [CV-BUTTON] with name close: for returning - uses variables: - key: title value: title of canvas - key: text value: the text - key: velo value: moving velocitas in pixels - key: default font value: font, e.g. sys:low - key: fgcolor value: text color, e.g. 0xff0000

EXAMPLE
  struct VG_Hash *hvar;

  hvar = vg4->hash->create();

  /* set variables */
  vg4->hash->setstr(hvar, "top:title", "Title");
  vg4->hash->setstr(hvar, "top:text", "Any silly text");
  vg4->hash->setstr(hvar, "top:velo", "5");

  /* execute dialog */
  if (!vg4->dialog->text("small", NULL, NULL, hvar)) {
    /* exit request */
    VG_dest();
    exit(0);
  }

  vg4->hash->destroy(hvar);