Package arc.scene.ui
Class Image
java.lang.Object
arc.scene.Element
arc.scene.ui.Image
- Direct Known Subclasses:
BorderImage
,ColorImage
,SchematicsDialog.SchematicImage
Displays a
Drawable
, scaled various way within the widgets bounds. The preferred size is the min size of the drawable.
Only when using a TextureRegionDrawable
will the actor's scale, rotation, and origin be used when drawing.-
Field Summary
Modifier and TypeFieldDescriptionprotected float
protected float
protected float
protected float
Fields inherited from class arc.scene.Element
color, cullable, fillParent, height, name, originX, originY, parent, parentAlpha, rotation, scaleX, scaleY, touchable, touchablility, translation, userObject, visibility, visible, width, x, y
-
Constructor Summary
ConstructorDescriptionImage()
Creates an image with no region or patch, stretched, and aligned center.Creates an image stretched, and aligned center.Image
(TextureRegion region) Creates an image stretched, and aligned center.Creates an image stretched, and aligned center.Creates an image stretched, and aligned center.Creates an image aligned center. -
Method Summary
Modifier and TypeMethodDescriptionvoid
draw()
Draws the element.float
float
float
float
float
float
float
float
void
layout()
Computes and caches any information needed for drawing and, if this actor has children, positions and sizes each child, callsElement.invalidate()
on any each child whose width or height has changed, and callsElement.validate()
on each child.void
setAlign
(int align) void
setDrawable
(TextureRegion region) void
setDrawable
(Drawable drawable) setScaling
(Scaling scaling) Methods inherited from class arc.scene.Element
act, actions, addAction, addCaptureListener, addListener, change, changed, clear, clearActions, clearListeners, clicked, clicked, clicked, clicked, clipBegin, clipBegin, clipEnd, dragged, exited, fire, fireClick, getActions, getCaptureListeners, getHeight, getListeners, getMaxHeight, getMaxWidth, getRight, getRotation, getScene, getTop, getWidth, getX, getY, getZIndex, hasActions, hasKeyboard, hasMouse, hasParent, hasScroll, hit, hovered, invalidate, invalidateHierarchy, isAscendantOf, isDescendantOf, isDescendantOf, isTouchable, keepInStage, keyDown, keyDown, localToAscendantCoordinates, localToParentCoordinates, localToStageCoordinates, moveBy, needsLayout, notify, pack, parentToLocalCoordinates, released, remove, removeAction, removeCaptureListener, removeListener, requestKeyboard, requestScroll, rotateBy, rotationChanged, scaleBy, scaleBy, screenToLocalCoordinates, scrolled, setBounds, setColor, setColor, setFillParent, setHeight, setLayoutEnabled, setOrigin, setOrigin, setPosition, setPosition, setRotation, setRotationOrigin, setScale, setScale, setScene, setSize, setSize, setTranslation, setWidth, setZIndex, sizeBy, sizeBy, sizeChanged, stageToLocalCoordinates, tapped, toBack, toFront, toString, touchable, update, updateVisibility, validate, visible
-
Field Details
-
imageX
protected float imageX -
imageY
protected float imageY -
imageWidth
protected float imageWidth -
imageHeight
protected float imageHeight
-
-
Constructor Details
-
Image
public Image()Creates an image with no region or patch, stretched, and aligned center. -
Image
-
Image
Creates an image stretched, and aligned center.- Parameters:
patch
- May be null.
-
Image
Creates an image stretched, and aligned center.- Parameters:
region
- May be null.
-
Image
Creates an image stretched, and aligned center. -
Image
Creates an image stretched, and aligned center.- Parameters:
drawable
- May be null.
-
Image
Creates an image aligned center.- Parameters:
drawable
- May be null.
-
Image
- Parameters:
drawable
- May be null.
-
-
Method Details
-
layout
public void layout()Description copied from class:Element
Computes and caches any information needed for drawing and, if this actor has children, positions and sizes each child, callsElement.invalidate()
on any each child whose width or height has changed, and callsElement.validate()
on each child. This method should almost never be called directly, insteadElement.validate()
should be used. -
draw
public void draw()Description copied from class:Element
Draws the element. Does nothing by default. -
getRegion
-
getDrawable
- Returns:
- May be null.
-
setDrawable
-
setDrawable
- Parameters:
drawable
- May be null.
-
setScaling
-
setAlign
public void setAlign(int align) -
getMinWidth
public float getMinWidth()- Overrides:
getMinWidth
in classElement
-
getMinHeight
public float getMinHeight()- Overrides:
getMinHeight
in classElement
-
getPrefWidth
public float getPrefWidth()- Overrides:
getPrefWidth
in classElement
-
getPrefHeight
public float getPrefHeight()- Overrides:
getPrefHeight
in classElement
-
getImageX
public float getImageX() -
getImageY
public float getImageY() -
getImageWidth
public float getImageWidth() -
getImageHeight
public float getImageHeight()
-