View on
MetaCPAN
Barry King > Apache-Wyrd > Apache::Wyrd::Site::GDButton

Download:
Apache-Wyrd-0.98.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 0.98   Source  

Apache::Wyrd::Site::GDButton - Auto-generated buttons/text graphics ^

A wyrd to generate rectangular buttons using the GD library.

SYNOPSIS ^

        <BASENAME::GDButton name="pushme" src="/img/pushbutton.gif" />

DESCRIPTION ^

GDButton produces a rectangular button with given text using the GD library. It can produce either image input or img tags, as requested.

GDButton uses it's membership in the Apache::Wyrd::Site::Widget class to track changes and decide when the output file should be regenerated. Note: GDButton internally draws itself at 5x the regular size and scales down in order to make a more aesthetically pleasing final result.

HTML ATTRIBUTES

src

File attribute. Must be absolute, relative, or root-dir-relative. Will seek through those options to find a writeable location and set the HTML attribute of the same to reflect the location of the output file. This file must end in either .png or .gif. The format of the output file will be determined by this file extension.

template

What file to use as a base image for this button. It is located in the same way the src file is. The file can be a GIF or PNG file (it will need to have the right file extension of .gif or .png, case insensitive). The template file is copied to memory and then written to the file area indicated by the src attribute.

width, height

(required w/o template) in pixels.

bgcolor, color

(required w/o template) background and foreground color, in six-digit hex form (#RRGGBB).

size

Font size, in pixels.

font

Path to the font file. Either absolute, relative, or root-dir-relative. It must be a TrueType font file, and your version of GD must support TrueType fonts.

margin, tmargin, rmargin, bmargin, lmargin

Margin between text and edge of button, in pixels. Margin represents an overall number, and is the default for the others. Specific top, right, bottom, and left margins can be defined separately, falling back to the margin value.

name id action method alt align onmouseover onmouseout onclick border ismap longdesc usemap

Regular image attributes. Passed to the HTML untouched.

FLAGS

noantialias

Turn off antialiasing for the button.

BUGS/CAVEATS ^

Reserves the _format_output and _generate_output methods.

AUTHOR ^

Barry King <wyrd@nospam.wyrdwright.com>

SEE ALSO ^

Apache::Wyrd

General-purpose HTML-embeddable perl object

LICENSE ^

Copyright 2002-2007 Wyrdwright, Inc. and licensed under the GNU GPL.

See LICENSE under the documentation for Apache::Wyrd.

syntax highlighting: