Skip to content

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.

explicit ADrawableView::ADrawableView(_<IDrawable> drawable)

Create an instance from the given drawable.

Arguments
drawable
The IDrawable to be rendered.

drawable#


auto ADrawableView::drawable()

Drawable property.