new Gradient()
Creates an instance of Gradient.
Extends
Methods
-
addColorStop(x, color)
-
Parameters:
Name Type Description xnumber a value between 0.0 and 1.0 that represents the position between start and end in a gradient
colorstring a CSS color value to display at the stop position
-
applyTheme(theme)
-
Changes the theme to use with this
Element.Convenience method for classes which inherit from
Elementand use a theme so they don't need to apply Element theme properties themselves. Good practice is to override this method in all classes which support theme and may be subclassed.Parameters:
Name Type Description themeolympe.ui.std.theme.ElementTheme The theme.
- Inherited From:
- Overrides:
-
<abstract> getAbsolutePosition()
-
Returns the absolute position of this
Element.This method must be implemented by Element descendants.
- Inherited From:
- Overrides:
Returns:
Absolute position of this Element.
- Type
- olympe.df.PVector2
-
<abstract> getDimension()
-
Gets the dimension (width, height) of this
Element.- Inherited From:
- Overrides:
Returns:
Dimension of element.
- Type
- olympe.df.PVector2
-
getFocus()
-
Checks whether this
Elementhas the focus.Warning: Focus may not be applicable on some elements, depending on the platform.
- Inherited From:
- Overrides:
Returns:
trueif Element has focus.- Type
- olympe.df.POBoolean
-
<protected> getGestureEvent()
-
Gets the gesture event manager attached to this element
- Inherited From:
- Overrides:
Returns:
-
getHTMLElement()
-
Return the DOM HTMLElement if exists (may be null)
- Inherited From:
- Overrides:
Returns:
- Type
- Element
-
<protected> getMouseEvent()
-
Gets the mouse event manager attached to this element.
- Inherited From:
- Overrides:
Returns:
the mouse event manager.
-
getUIGradient()
-
Returns:
Returns the gradient as a UI element
- Type
- olympe.uiapi.std.Canvas
-
<protected> getUIProxyElement()
-
Returns the native UI element associated with this
Element.- Inherited From:
- Overrides:
Returns:
The proxy element from the UI thread.
- Type
- olympe.uiapi.std.Element
-
isHidden()
-
Checks whether this
Elementis hidden.- Inherited From:
- Overrides:
Returns:
trueis this element is hidden.- Type
- olympe.df.POBoolean
-
removeTooltip()
-
Removes the tooltip from this element.
- Inherited From:
- Overrides:
Returns:
This element.
-
setBackgroundColor(color)
-
Sets the background color for this
Element.Parameters:
Name Type Description colorolympe.df.Proxy | olympe.df.Node | olympe.df.Color The background color.
- Inherited From:
- Overrides:
Returns:
this
Element. -
setBackgroundImage(url [, sizingMode] [, positioningMode] [, size] [, position])
-
Sets the background image for this
Element.Notes:
Parameters:
Name Type Argument Default Description urlolympe.df.POString | olympe.df.Node | string URL for the image.
sizingModeolympe.ui.common.BackgroundImageSize | olympe.df.Proxy | olympe.df.Node <optional>
AUTO The sizing mode for the image.
positioningModeolympe.ui.common.BackgroundImagePosition | olympe.df.Proxy | olympe.df.Node <optional>
TOPLEFT The positioning mode for this image.
sizeolympe.df.Vector2 | olympe.df.Proxy | olympe.df.Node <optional>
Size, in pixel.
positionolympe.df.Vector2 | olympe.df.Proxy | olympe.df.Node <optional>
Position of the image, in pixel. (0,0) if omitted.
- Inherited From:
- Overrides:
Returns:
this
Element. -
setBackgroundImagePosition(position)
-
Sets the background image position for this
Element.Parameters:
Name Type Description positionolympe.df.Vector2 | olympe.df.Proxy | olympe.df.Node The position.
- Inherited From:
- Overrides:
Returns:
this
Element. -
setBackgroundImagePositionMode(positionMode)
-
Sets the position mode for the background image of this
Element.Parameters:
Name Type Description positionModeolympe.ui.common.BackgroundImagePosition | olympe.df.Proxy | olympe.df.Node The positioning mode for this image.
- Inherited From:
- Overrides:
Returns:
this
Element. -
setBackgroundImageSize(size)
-
Sets the background image size for the this
Element.Parameters:
Name Type Description sizeolympe.df.Vector2 | olympe.df.Proxy | olympe.df.Node The image size, in pixels.
- Inherited From:
- Overrides:
Returns:
this
Element. -
setBackgroundImageSizeMode(sizeMode)
-
Sets the sizing mode for the background image of this
Element.Parameters:
Name Type Description sizeModeolympe.ui.common.BackgroundImageSize | olympe.df.Proxy | olympe.df.Node The sizing mode.
- Inherited From:
- Overrides:
Returns:
this
Element. -
setBackgroundImageSrc(src)
-
Sets the URL (or source) for the background image.
Parameters:
Name Type Description srcolympe.df.POString | olympe.df.Node | string URL for the image.
- Inherited From:
- Overrides:
Returns:
this
Element. -
setBlur()
-
Removes focus from this Element.
Warnings:
- Focus may not be applicable on some elements, depending on the platform.
- Elements not inside a container (screen, etc.) can't get the focus.
- Inherited From:
- Overrides:
Returns:
this
Element. -
setContextMenuEnabled(enabled)
-
Enable/disable context menu on this element.
Parameters:
Name Type Description enabledboolean trueto enable the context menu,falseto disable it.- Inherited From:
- Overrides:
Returns:
this
Element. -
setFocus()
-
Gives the focus to this Element.
Warnings:
- Focus may not be applicable on some elements, depending on the platform.
- Elements not inside a container (screen, etc.) can't get the focus.
- Inherited From:
- Overrides:
Returns:
this
Element. -
setHidden(hidden)
-
Sets whether this
Elementis hidden or not. A hidden element will not appear on the screen.Parameters:
Name Type Description hiddenolympe.df.POBoolean | boolean | olympe.df.Node trueif content must be hidden,falseotherwise.- Inherited From:
- Overrides:
Returns:
this
Element. -
setIgnoreUserInteraction( [ignore])
-
Disables mouse events for this element. However, mouse events will target its descendants unless they are manually set to also ignore user interactions.
Parameters:
Name Type Argument Default Description ignoreboolean | olympe.df.POBoolean <optional>
false ignore
trueto make this element ignore mouse events and pass them to its children.- Inherited From:
- Overrides:
Returns:
this
Element. -
setOpacity(opacity)
-
Sets the opacity, or alpha channel, for this
Element. This is a float value between 0 and 1. 0 being transparent and 1 being opaque.Parameters:
Name Type Description opacityolympe.df.ONumber | number | olympe.df.Proxy | olympe.df.Node the opacity (between 0 and 1).
- Inherited From:
- Overrides:
Returns:
this
Element. -
setStyle(style, value)
-
Parameters:
Name Type Description stylestring CSS style name
valuestring | number CSS style value
- Inherited From:
- Overrides:
Returns:
this
Element. -
setTabIndex(tabIndex)
-
Sets the tab index to this
Element. Tab Index defines the tabulation or 'next' order while going through a form.Parameters:
Name Type Description tabIndexolympe.df.PONumber | olympe.df.ONumber | number | olympe.df.Node The tab index.
- Inherited From:
- Overrides:
Returns:
this
Element. -
setTooltip(text [, options])
-
Assigns a tooltip to that element that will show up when the mouse hovers over it.
Parameters:
Name Type Argument Description textolympe.df.POString The text of the tooltip.
optionsObject <optional>
Various options for displaying the tooltip.
Properties
Name Type Argument Description positionolympe.df.PVector2 <optional>
The absolute position of the tooltip.
backgroundolympe.df.PColor <optional>
The background color.
foregroundolympe.df.PColor <optional>
The text color.
fontSizeolympe.df.PONumber <optional>
The font size.
borderSizeolympe.df.PONumber <optional>
The size of the border. Default is 1.
borderColorolympe.df.PColor <optional>
The color of the border. Default is black.
delayolympe.df.ONumber | number <optional>
The delay, in milliseconds, before showing the tooltip. Default is 500.
startingPosolympe.df.Vector2 <optional>
The starting position of the mouse. Default is (0,0).
themeolympe.df.POString <optional>
The theme class to apply to this tooltip.
- Inherited From:
- Overrides:
Returns:
This Element.
Olympe SDK