Class Image
Hierarchy
-
Control
- Image
Index
Constructors
Properties
- clip
Children - clip
Content - fixed
Ratio - hover
Cursor - is
Focus Invisible - is
Hit Test Visible - is
Pointer Blocker - metadata
- name
- on
After Draw Observable - on
Before Draw Observable - on
Dirty Observable - on
Dispose Observable - on
Image Loaded Observable - on
Pointer Click Observable - on
Pointer Down Observable - on
Pointer Enter Observable - on
Pointer Move Observable - on
Pointer Out Observable - on
Pointer UpObservable - onSVGAttributes
Computed Observable - on
Wheel Observable - parent
- unique
Id - use
Bitmap Cache - Allow
Alpha Inheritance - STRETCH_
EXTEND - STRETCH_
FILL - STRETCH_
NINE_ PATCH - STRETCH_
NONE - STRETCH_
UNIFORM
Accessors
- alpha
- auto
Scale - cell
Height - cell
Id - cell
Width - centerX
- centerY
- color
- detect
Pointer OnOpaque Only - disabled
Color - disabled
Color Item - dom
Image - font
Family - font
Offset - font
Size - font
Size InPixels - font
Style - font
Weight - height
- height
InPixels - horizontal
Alignment - host
- is
Dirty - is
Enabled - is
Highlighted - is
Loaded - isSVG
- is
Visible - left
- left
InPixels - link
OffsetX - link
OffsetXIn Pixels - link
OffsetY - link
OffsetYIn Pixels - linked
Mesh - not
Renderable - padding
Bottom - padding
Bottom InPixels - padding
Left - padding
Left InPixels - padding
Right - padding
Right InPixels - padding
Top - padding
Top InPixels - populate
Nine Patch Slices From Image - rotation
- scaleX
- scaleY
- shadow
Blur - shadow
Color - shadow
OffsetX - shadow
OffsetY - slice
Bottom - slice
Left - slice
Right - slice
Top - source
- source
Height - source
Left - source
Top - source
Width - stretch
- style
- svg
Attributes Computation Completed - top
- top
InPixels - transform
CenterX - transform
CenterY - type
Name - vertical
Alignment - width
- width
InPixels - z
Index - HORIZONTAL_
ALIGNMENT_ CENTER - HORIZONTAL_
ALIGNMENT_ LEFT - HORIZONTAL_
ALIGNMENT_ RIGHT - VERTICAL_
ALIGNMENT_ BOTTOM - VERTICAL_
ALIGNMENT_ CENTER - VERTICAL_
ALIGNMENT_ TOP
Methods
Constructors
constructor
Properties
clip ChildrenSearch playground for clipChildren
Gets or sets a boolean indicating if the children are clipped to the current control bounds. Please note that not clipping children may generate issues with adt.useInvalidateRectOptimization so it is recommended to turn this optimization off if you want to use unclipped children
clip ContentSearch playground for clipContent
Gets or sets a boolean indicating that control content must be clipped Please note that not clipping children may generate issues with adt.useInvalidateRectOptimization so it is recommended to turn this optimization off if you want to use unclipped children
fixed RatioSearch playground for fixedRatio
Gets or sets a fixed ratio for this control. When different from 0, the ratio is used to compute the "second" dimension. The first dimension used in the computation is the last one set (by setting width / widthInPixels or height / heightInPixels), and the second dimension is computed as first dimension * fixedRatio
hover CursorSearch playground for hoverCursor
Gets or sets the cursor to use when the control is hovered
is Focus InvisibleSearch playground for isFocusInvisible
Gets or sets a boolean indicating if the control can be focusable
is Hit Test VisibleSearch playground for isHitTestVisible
Gets or sets a boolean indicating if the control can be hit with pointer events
is Pointer BlockerSearch playground for isPointerBlocker
Gets or sets a boolean indicating if the control can block pointer events
metadataSearch playground for metadata
Gets or sets an object used to store user defined information for the node
Optional nameSearch playground for name
on After Draw ObservableSearch playground for onAfterDrawObservable
An event triggered after the control was drawn
on Before Draw ObservableSearch playground for onBeforeDrawObservable
An event triggered before drawing the control
on Dirty ObservableSearch playground for onDirtyObservable
An event triggered when the control is marked as dirty
on Dispose ObservableSearch playground for onDisposeObservable
An event triggered when the control has been disposed
on Image Loaded ObservableSearch playground for onImageLoadedObservable
BABYLON.Observable notified when the content is loaded
on Pointer Click ObservableSearch playground for onPointerClickObservable
An event triggered when a control is clicked on
on Pointer Down ObservableSearch playground for onPointerDownObservable
An event triggered when the pointer taps the control
on Pointer Enter ObservableSearch playground for onPointerEnterObservable
An event triggered when pointer enters the control
on Pointer Move ObservableSearch playground for onPointerMoveObservable
An event triggered when the pointer move over the control.
on Pointer Out ObservableSearch playground for onPointerOutObservable
An event triggered when the pointer move out of the control.
on Pointer UpObservableSearch playground for onPointerUpObservable
An event triggered when pointer up
onSVGAttributes Computed ObservableSearch playground for onSVGAttributesComputedObservable
BABYLON.Observable notified when _sourceLeft, _sourceTop, _sourceWidth and _sourceHeight are computed
on Wheel ObservableSearch playground for onWheelObservable
An event triggered when pointer wheel is scrolled
parentSearch playground for parent
Gets or sets the control parent
unique IdSearch playground for uniqueId
Gets or sets the unique id of the node. Please note that this number will be updated when the control is added to a container
use Bitmap CacheSearch playground for useBitmapCache
Gets or sets a boolean indicating that the current control should cache its rendering (useful when the control does not change often)
Static Allow Alpha InheritanceSearch playground for AllowAlphaInheritance
Gets or sets a boolean indicating if alpha must be an inherited value (false by default)
Static Readonly STRETCH_ EXTENDSearch playground for STRETCH_EXTEND
STRETCH_EXTEND
Static Readonly STRETCH_ FILLSearch playground for STRETCH_FILL
STRETCH_FILL
Static Readonly STRETCH_ NINE_ PATCHSearch playground for STRETCH_NINE_PATCH
NINE_PATCH
Static Readonly STRETCH_ NONESearch playground for STRETCH_NONE
STRETCH_NONE
Static Readonly STRETCH_ UNIFORMSearch playground for STRETCH_UNIFORM
STRETCH_UNIFORM
Accessors
alpha
-
Gets or sets alpha value for the control (1 means opaque and 0 means entirely transparent)
Returns number
-
Gets or sets alpha value for the control (1 means opaque and 0 means entirely transparent)
Parameters
-
value: number
Returns any
-
auto Scale
-
Gets or sets a boolean indicating if the image can force its container to adapt its size
Returns boolean
-
Gets or sets a boolean indicating if the image can force its container to adapt its size
Parameters
-
value: boolean
Returns any
-
cell Height
-
Gets or sets the cell height to use when animation sheet is enabled
Returns number
-
Gets or sets the cell height to use when animation sheet is enabled
Parameters
-
value: number
Returns any
-
cell Id
-
Gets or sets the cell id to use (this will turn on the animation sheet mode)
Returns number
-
Gets or sets the cell id to use (this will turn on the animation sheet mode)
Parameters
-
value: number
Returns any
-
cell Width
-
Gets or sets the cell width to use when animation sheet is enabled
Returns number
-
Gets or sets the cell width to use when animation sheet is enabled
Parameters
-
value: number
Returns any
-
centerX
-
Gets the center coordinate on X axis
Returns number
centerY
-
Gets the center coordinate on Y axis
Returns number
color
-
Gets or sets foreground color
Returns string
-
Gets or sets foreground color
Parameters
-
value: string
Returns any
-
detect Pointer OnOpaque Only
-
Gets or sets a boolean indicating if pointers should only be validated on pixels with alpha > 0. Beware using this as this will comsume more memory as the image has to be stored twice
Returns boolean
-
Gets or sets a boolean indicating if pointers should only be validated on pixels with alpha > 0. Beware using this as this will comsume more memory as the image has to be stored twice
Parameters
-
value: boolean
Returns any
-
disabled Color
-
Gets or sets background color of control if it's disabled
Returns string
-
Gets or sets background color of control if it's disabled
Parameters
-
value: string
Returns any
-
disabled Color Item
-
Gets or sets front color of control if it's disabled
Returns string
-
Gets or sets front color of control if it's disabled
Parameters
-
value: string
Returns any
-
dom Image
-
Gets or sets the internal DOM image used to render the control
Returns HTMLImageElement
-
Gets or sets the internal DOM image used to render the control
Parameters
-
value: HTMLImageElement
Returns any
-
font Family
-
Gets or set font family
Returns string
-
Gets or set font family
Parameters
-
value: string
Returns any
-
font Offset
-
Gets or set information about font offsets (used to render and align text)
Returns { ascent: number; descent: number; height: number }
-
ascent: number
-
descent: number
-
height: number
-
-
Gets or set information about font offsets (used to render and align text)
Parameters
-
offset: { ascent: number; descent: number; height: number }
-
ascent: number
-
descent: number
-
height: number
-
Returns any
-
font Size
-
Gets or sets font size
Returns string | number
-
Gets or sets font size
Parameters
-
value: string | number
Returns any
-
font Size InPixels
-
Gets or sets font size in pixels
Returns number
-
Gets or sets font size in pixels
Parameters
-
value: number
Returns any
-
font Style
-
Gets or sets font style
Returns string
-
Gets or sets font style
Parameters
-
value: string
Returns any
-
font Weight
-
Gets or sets font weight
Returns string
-
Gets or sets font weight
Parameters
-
value: string
Returns any
-
height
-
Gets or sets control height
Returns string | number
-
Gets or sets control height
Parameters
-
value: string | number
Returns any
-
height InPixels
-
Gets or sets control height in pixel
Returns number
-
Gets or sets control height in pixel
Parameters
-
value: number
Returns any
-
horizontal Alignment
-
Gets or sets the horizontal alignment
Returns number
-
Gets or sets the horizontal alignment
Parameters
-
value: number
Returns any
-
host
-
Get the hosting AdvancedDynamicTexture
Returns AdvancedDynamicTexture
is Dirty
-
Gets a boolean indicating that the control needs to update its rendering
Returns boolean
is Enabled
-
Gets or sets if control is Enabled
Returns boolean
-
Gets or sets if control is Enabled
Parameters
-
value: boolean
Returns any
-
is Highlighted
-
Gets or sets a boolean indicating that we want to highlight the control (mostly for debugging purpose)
Returns boolean
-
Gets or sets a boolean indicating that we want to highlight the control (mostly for debugging purpose)
Parameters
-
value: boolean
Returns any
-
is Loaded
-
Gets a boolean indicating that the content is loaded
Returns boolean
isSVG
-
Indicates if the format of the image is SVG
Returns boolean
is Visible
-
Gets or sets a boolean indicating if the control is visible
Returns boolean
-
Gets or sets a boolean indicating if the control is visible
Parameters
-
value: boolean
Returns any
-
left
-
Gets or sets a value indicating the left coordinate of the control
Returns string | number
-
Gets or sets a value indicating the left coordinate of the control
Parameters
-
value: string | number
Returns any
-
left InPixels
-
Gets or sets a value indicating the left coordinate in pixels of the control
Returns number
-
Gets or sets a value indicating the left coordinate in pixels of the control
Parameters
-
value: number
Returns any
-
link OffsetX
-
Gets or sets a value indicating the offset on X axis to the linked mesh
Returns string | number
-
Gets or sets a value indicating the offset on X axis to the linked mesh
Parameters
-
value: string | number
Returns any
-
link OffsetXIn Pixels
-
Gets or sets a value indicating the offset in pixels on X axis to the linked mesh
Returns number
-
Gets or sets a value indicating the offset in pixels on X axis to the linked mesh
Parameters
-
value: number
Returns any
-
link OffsetY
-
Gets or sets a value indicating the offset on Y axis to the linked mesh
Returns string | number
-
Gets or sets a value indicating the offset on Y axis to the linked mesh
Parameters
-
value: string | number
Returns any
-
link OffsetYIn Pixels
-
Gets or sets a value indicating the offset in pixels on Y axis to the linked mesh
Returns number
-
Gets or sets a value indicating the offset in pixels on Y axis to the linked mesh
Parameters
-
value: number
Returns any
-
linked Mesh
-
Gets the current linked mesh (or null if none)
Returns Nullable<TransformNode>
not Renderable
-
Gets or sets a boolean indicating if the control can be rendered
Returns boolean
-
Gets or sets a boolean indicating if the control can be rendered
Parameters
-
value: boolean
Returns any
-
padding Bottom
-
Gets or sets a value indicating the padding to use on the bottom of the control
Returns string | number
-
Gets or sets a value indicating the padding to use on the bottom of the control
Parameters
-
value: string | number
Returns any
-
padding Bottom InPixels
-
Gets or sets a value indicating the padding in pixels to use on the bottom of the control
Returns number
-
Gets or sets a value indicating the padding in pixels to use on the bottom of the control
Parameters
-
value: number
Returns any
-
padding Left
-
Gets or sets a value indicating the padding to use on the left of the control
Returns string | number
-
Gets or sets a value indicating the padding to use on the left of the control
Parameters
-
value: string | number
Returns any
-
padding Left InPixels
-
Gets or sets a value indicating the padding in pixels to use on the left of the control
Returns number
-
Gets or sets a value indicating the padding in pixels to use on the left of the control
Parameters
-
value: number
Returns any
-
padding Right
-
Gets or sets a value indicating the padding to use on the right of the control
Returns string | number
-
Gets or sets a value indicating the padding to use on the right of the control
Parameters
-
value: string | number
Returns any
-
padding Right InPixels
-
Gets or sets a value indicating the padding in pixels to use on the right of the control
Returns number
-
Gets or sets a value indicating the padding in pixels to use on the right of the control
Parameters
-
value: number
Returns any
-
padding Top
-
Gets or sets a value indicating the padding to use on the top of the control
Returns string | number
-
Gets or sets a value indicating the padding to use on the top of the control
Parameters
-
value: string | number
Returns any
-
padding Top InPixels
-
Gets or sets a value indicating the padding in pixels to use on the top of the control
Returns number
-
Gets or sets a value indicating the padding in pixels to use on the top of the control
Parameters
-
value: number
Returns any
-
populate Nine Patch Slices From Image
-
Gets or sets a boolean indicating if nine patch slices (left, top, right, bottom) should be read from image data
Returns boolean
-
Gets or sets a boolean indicating if nine patch slices (left, top, right, bottom) should be read from image data
Parameters
-
value: boolean
Returns any
-
rotation
-
Gets or sets the rotation angle (0 by default)
Returns number
-
Gets or sets the rotation angle (0 by default)
Parameters
-
value: number
Returns any
-
scaleX
-
Gets or sets a value indicating the scale factor on X axis (1 by default)
Returns number
-
Gets or sets a value indicating the scale factor on X axis (1 by default)
Parameters
-
value: number
Returns any
-
scaleY
-
Gets or sets a value indicating the scale factor on Y axis (1 by default)
Returns number
-
Gets or sets a value indicating the scale factor on Y axis (1 by default)
Parameters
-
value: number
Returns any
-
shadow Blur
-
Gets or sets a value indicating the amount of blur to use to render the shadow
Returns number
-
Gets or sets a value indicating the amount of blur to use to render the shadow
Parameters
-
value: number
Returns any
-
shadow Color
-
Gets or sets a value indicating the color of the shadow (black by default ie. "#000")
Returns string
-
Gets or sets a value indicating the color of the shadow (black by default ie. "#000")
Parameters
-
value: string
Returns any
-
shadow OffsetX
-
Gets or sets a value indicating the offset to apply on X axis to render the shadow
Returns number
-
Gets or sets a value indicating the offset to apply on X axis to render the shadow
Parameters
-
value: number
Returns any
-
shadow OffsetY
-
Gets or sets a value indicating the offset to apply on Y axis to render the shadow
Returns number
-
Gets or sets a value indicating the offset to apply on Y axis to render the shadow
Parameters
-
value: number
Returns any
-
slice Bottom
-
Gets or sets the bottom value for slicing (9-patch)
Returns number
-
Gets or sets the bottom value for slicing (9-patch)
Parameters
-
value: number
Returns any
-
slice Left
-
Gets or sets the left value for slicing (9-patch)
Returns number
-
Gets or sets the left value for slicing (9-patch)
Parameters
-
value: number
Returns any
-
slice Right
-
Gets or sets the right value for slicing (9-patch)
Returns number
-
Gets or sets the right value for slicing (9-patch)
Parameters
-
value: number
Returns any
-
slice Top
-
Gets or sets the top value for slicing (9-patch)
Returns number
-
Gets or sets the top value for slicing (9-patch)
Parameters
-
value: number
Returns any
-
source
source Height
-
Gets or sets the height to capture in the source image
Returns number
-
Gets or sets the height to capture in the source image
Parameters
-
value: number
Returns any
-
source Left
-
Gets or sets the left coordinate in the source image
Returns number
-
Gets or sets the left coordinate in the source image
Parameters
-
value: number
Returns any
-
source Top
-
Gets or sets the top coordinate in the source image
Returns number
-
Gets or sets the top coordinate in the source image
Parameters
-
value: number
Returns any
-
source Width
-
Gets or sets the width to capture in the source image
Returns number
-
Gets or sets the width to capture in the source image
Parameters
-
value: number
Returns any
-
stretch
-
Gets or sets the streching mode used by the image
Returns number
-
Gets or sets the streching mode used by the image
Parameters
-
value: number
Returns any
-
style
svg Attributes Computation Completed
-
Gets the status of the SVG attributes computation (sourceLeft, sourceTop, sourceWidth, sourceHeight)
Returns boolean
top
-
Gets or sets a value indicating the top coordinate of the control
Returns string | number
-
Gets or sets a value indicating the top coordinate of the control
Parameters
-
value: string | number
Returns any
-
top InPixels
-
Gets or sets a value indicating the top coordinate in pixels of the control
Returns number
-
Gets or sets a value indicating the top coordinate in pixels of the control
Parameters
-
value: number
Returns any
-
transform CenterX
-
Gets or sets the transformation center on X axis (0 by default)
Returns number
-
Gets or sets the transformation center on X axis (0 by default)
Parameters
-
value: number
Returns any
-
transform CenterY
-
Gets or sets the transformation center on Y axis (0 by default)
Returns number
-
Gets or sets the transformation center on Y axis (0 by default)
Parameters
-
value: number
Returns any
-
type Name
-
Gets the control type name
Returns string
vertical Alignment
-
Gets or sets the vertical alignment
Returns number
-
Gets or sets the vertical alignment
Parameters
-
value: number
Returns any
-
width
-
Gets or sets control width
Returns string | number
-
Gets or sets control width
Parameters
-
value: string | number
Returns any
-
width InPixels
-
Gets or sets the control width in pixel
Returns number
-
Gets or sets the control width in pixel
Parameters
-
value: number
Returns any
-
z Index
-
Gets or sets z index which is used to reorder controls on the z axis
Returns number
-
Gets or sets z index which is used to reorder controls on the z axis
Parameters
-
value: number
Returns any
-
Static HORIZONTAL_ ALIGNMENT_ CENTER
-
HORIZONTAL_ALIGNMENT_CENTER
Returns number
Static HORIZONTAL_ ALIGNMENT_ LEFT
-
HORIZONTAL_ALIGNMENT_LEFT
Returns number
Static HORIZONTAL_ ALIGNMENT_ RIGHT
-
HORIZONTAL_ALIGNMENT_RIGHT
Returns number
Static VERTICAL_ ALIGNMENT_ BOTTOM
-
VERTICAL_ALIGNMENT_BOTTOM
Returns number
Static VERTICAL_ ALIGNMENT_ CENTER
-
VERTICAL_ALIGNMENT_CENTER
Returns number
Static VERTICAL_ ALIGNMENT_ TOP
-
VERTICAL_ALIGNMENT_TOP
Returns number
Methods
_drawSearch playground for _draw
-
Parameters
-
context: CanvasRenderingContext2D
Returns void
-
containsSearch playground for contains
-
Tests if a given coordinates belong to the current control
Parameters
-
x: number
defines x coordinate to test
-
y: number
defines y coordinate to test
Returns boolean
true if the coordinates are inside the control
-
disposeSearch playground for dispose
-
Returns void
get Ascendant OfClassSearch playground for getAscendantOfClass
get Class NameSearch playground for getClassName
-
Get the current class name of the control.
Returns string
current class name
get DescendantsSearch playground for getDescendants
-
Will return all controls that have this control as ascendant
Parameters
-
Optional directDescendantsOnly: boolean
defines if true only direct descendants of 'this' will be considered, if false direct and also indirect (children of children, an so on in a recursive manner) descendants of 'this' will be considered
-
Optional predicate: (control: Control) => boolean
defines an optional predicate that will be called on every evaluated child, the predicate must return true for a given child to be part of the result, otherwise it will be ignored
-
-
Parameters
-
control: Control
Returns boolean
-
-
-
Returns Control[]
all child controls
-
get Descendants ToRefSearch playground for getDescendantsToRef
-
Will store all controls that have this control as ascendant in a given array
Parameters
-
results: Control[]
defines the array where to store the descendants
-
Optional directDescendantsOnly: boolean
defines if true only direct descendants of 'this' will be considered, if false direct and also indirect (children of children, an so on in a recursive manner) descendants of 'this' will be considered
-
Optional predicate: (control: Control) => boolean
defines an optional predicate that will be called on every evaluated child, the predicate must return true for a given child to be part of the result, otherwise it will be ignored
-
-
Parameters
-
control: Control
Returns boolean
-
-
-
Returns void
-
get Local CoordinatesSearch playground for getLocalCoordinates
get Local Coordinates ToRefSearch playground for getLocalCoordinatesToRef
get Parent Local CoordinatesSearch playground for getParentLocalCoordinates
is AscendantSearch playground for isAscendant
-
Determines if a container is an ascendant of the current control
Parameters
-
container: Control
defines the container to look for
Returns boolean
true if the container is one of the ascendant of the control
-
link With MeshSearch playground for linkWithMesh
-
Link current control with a target mesh
Parameters
-
mesh: Nullable<TransformNode>
defines the mesh to link with
Returns void
-
move ToVector3Search playground for moveToVector3
serializeSearch playground for serialize
-
Serializes the current control
Parameters
-
serializationObject: any
defined the JSON serialized object
Returns void
-
set PaddingSearch playground for setPadding
-
Shorthand funtion to set the top, right, bottom, and left padding values on the control.
Parameters
-
paddingTop: string | number
The value of the top padding.
-
Optional paddingRight: string | number
The value of the right padding. If omitted, top is used.
-
Optional paddingBottom: string | number
The value of the bottom padding. If omitted, top is used.
-
Optional paddingLeft: string | number
The value of the left padding. If omitted, right is used.
Returns void
-
set Padding InPixelsSearch playground for setPaddingInPixels
-
Shorthand funtion to set the top, right, bottom, and left padding values in pixels on the control.
Parameters
-
paddingTop: number
The value in pixels of the top padding.
-
Optional paddingRight: number
The value in pixels of the right padding. If omitted, top is used.
-
Optional paddingBottom: number
The value in pixels of the bottom padding. If omitted, top is used.
-
Optional paddingLeft: number
The value in pixels of the left padding. If omitted, right is used.
Returns void
-
synchronize Size With ContentSearch playground for synchronizeSizeWithContent
-
Force the control to synchronize with its content
Returns void
Static ParseSearch playground for Parse
-
Creates a Control from parsed data
Parameters
-
serializedObject: any
defines parsed data
-
host: AdvancedDynamicTexture
defines the hosting AdvancedDynamicTexture
Returns Control
a new Control
-
Class used to create 2D images