Websites Navigation: Airbit | Shop | m-shell.net
Languages: EN | DE

Class abgui.Image

is abguibase.Widget
Known direct subclasses: abgui.ImageButton
An image widget displaying an image (icon).

Constructor

function init(pathOrIcon=null, align=HCENTER|VCENTER)
Overridesabguibase.Widget.init()
Initialize a new image.
Parameters:
pathOrIcon – either a path to an icon file, or an icon loaded via graph.icon. null if the icon cannot be set yet.
align – the horizontal and vertical alignment flags.

Fields

flags The flags, defining horizontal and vertical alignment of the icon within the image's rectangle.
icon The icon to display.

Functions

desiredSize() Get or compute the desired size.
draw() Draw the image on its background.
drawIcon(x, y) Draw the icon at a specific position.
setIcon(pathOrIcon) Set the icon to show.
function setIcon(pathOrIcon)
Set the icon to show.
Parameters:
pathOrIcon – either a path to an icon file, or an icon loaded via graph.icon.
function drawIcon(x, y)
Draw the icon at a specific position.
Parameters:
x – the x coordinate of the top left corner.
y – the y coordinate of the top left corner.
function draw()
Overridesabguibase.Widget.draw()
Draw the image on its background.
function desiredSize()
Overridesabguibase.Widget.desiredSize()
Get or compute the desired size. The default size depends on the icon size.
Returns:the size, as [width, height].
mShell Home  > Documentation  > mdoc