#include <ElementImage.h>


Public Member Functions | |
| ElementImage (const String &tag) | |
| bool | GetIntrinsicDimensions (Vector2f &dimensions) |
Protected Member Functions | |
| virtual void | OnRender () |
| Renders the image. | |
| virtual void | OnAttributeChange (const AttributeNameList &changed_attributes) |
| virtual void | ProcessEvent (Event &event) |
The 'coords' attribute is similar to that of the HTML imagemap. It takes four comma-separated integer values, specifying the top-left and the bottom right of the region in pixel-coordinates, in that order. So for example, the attribute "coords" = "0, 10, 100, 210" will render a 100 x 200 region, beginning at (0, 10) and rendering through to (100, 210). No clamping to the dimensions of the source image will occur; rendered results in this case will depend on the texture addressing mode.
The intrinsic dimensions of the image can now come from three different sources. They are used in the following order:
1) 'width' / 'height' attributes if present 2) pixel width / height given by the 'coords' attribute 3) width / height of the source texture
This has the result of sizing the element to the pixel-size of the rendered image, unless overridden by the 'width' or 'height' attributes.
| Rocket::Core::ElementImage::ElementImage | ( | const String & | tag | ) |
Constructs a new ElementImage. This should not be called directly; use the Factory instead.
| [in] | tag | The tag the element was declared as in RML. |
| bool Rocket::Core::ElementImage::GetIntrinsicDimensions | ( | Vector2f & | dimensions | ) | [virtual] |
Returns the element's inherent size.
| [out] | The | element's intrinsic dimensions. |
Reimplemented from Rocket::Core::Element.
| void Rocket::Core::ElementImage::OnAttributeChange | ( | const AttributeNameList & | changed_attributes | ) | [protected, virtual] |
Checks for changes to the image's source or dimensions.
| [in] | changed_attributes | A list of attributes changed on the element. |
Reimplemented from Rocket::Core::Element.
| void Rocket::Core::ElementImage::ProcessEvent | ( | Event & | event | ) | [protected, virtual] |
Regenerates the element's geometry on a resize event.
| [in] | event | The event to process. |
Reimplemented from Rocket::Core::Element.