ADrawableView#
Simple view to draw an IDrawable.
Header: | #include <AUI/View/ADrawableView.h> |
CMake: | aui_link(my_target PUBLIC aui::views) |
Detailed Description#
ADrawableView brings you more control over the drawable. This is useful for drawables with extended interface (i.e., AAnimatedImage).
The sizing and positioning acts like ass::BackgroundImage. Moreover, these rules are taken from ass::BackgroundImage applied to ADrawableView:
auto drawable = IDrawable::fromUrl(":animation.webp");
_new<ADrawableView>(drawable) AUI_WITH_STYLE {
BackgroundImage({}, {}, {}, Sizing::COVER), // <- drawable is sized and positioned as with COVER.
};
When applying ass::BackgroundImage, do not pass url to it, it's redundant for ADrawableView and would cause a debug error.
Public Methods#
ADrawableView#
explicit ADrawableView::ADrawableView(const AUrl& url)
Create an instance with the URL of a image resource.
- Arguments
url
URL to the image resource.
Create an instance from the given drawable.
- Arguments
drawable
The IDrawable to be rendered.
drawable#
Drawable property.