404 Page not found
Page not found, sorry.
diff --git a/404.html b/404.html index 22a4486..607808c 100644 --- a/404.html +++ b/404.html @@ -1 +1 @@ -
Page not found, sorry.
Page not found, sorry.
@:value({ args : null })staticsetInterval(closure:Function, delay:Int, ?args:Array<Dynamic>):UInt
Runs a function at a specified interval (in milliseconds).
+OpenFL Developer's Guide.@:value({ args : null })staticsetInterval(closure:Function, delay:Int, ?args:Array<Dynamic>):UInt
Runs a function at a specified interval (in milliseconds).
Instead of using the setInterval()
method, consider creating a Timer object, with
the specified interval, using 0 as the repeatCount
parameter (which sets the timer
to repeat indefinitely).
Available on all platforms
Adobe Flash Player supports an accelerated method of reading and +
Available on all platforms
Adobe Flash Player supports an accelerated method of reading and
writing to the ByteArray
object, known as "domain memory"
The Memory API provides access to domain memory using Memory.select
on an existing ByteArray
on the Flash target, and falls back to
diff --git a/openfl/Vector.html b/openfl/Vector.html
index bf067ec..08fbe76 100644
--- a/openfl/Vector.html
+++ b/openfl/Vector.html
@@ -1,7 +1,7 @@
-
The Vector class lets you access and manipulate a vector — an array whose elements +
The Vector class lets you access and manipulate a vector — an array whose elements all have the same data type. The data type of a Vector's elements is known as the Vector's base type. The base type can be any class, including built in classes and custom classes. The base type is specified when declaring a Vector variable as well diff --git a/openfl/desktop/Clipboard.html b/openfl/desktop/Clipboard.html index d236cea..8d0e928 100644 --- a/openfl/desktop/Clipboard.html +++ b/openfl/desktop/Clipboard.html @@ -1,7 +1,7 @@ -
Available on all platforms
The Clipboard class provides a container for transferring data and objects +
Available on all platforms
The Clipboard class provides a container for transferring data and objects
through the clipboard. The operating system clipboard can be accessed
through the static generalClipboard
property.
A Clipboard object can contain the same information in more than one
@@ -71,9 +71,9 @@
These constants for the names of the standard formats are defined in the ClipboardFormats class.
When a transfer to or from the operating system occurs, the standard -formats are automatically translated between ActionScript data types and +formats are automatically translated between Haxe data types and the native operating system clipboard types.
-You can use application-defined formats to add ActionScript objects to a +
You can use application-defined formats to add Haxe objects to a Clipboard object. If an object is serializable, both a reference and a clone of the object can be made available. Object references are valid only within the originating application.
diff --git a/openfl/desktop/ClipboardFormats.html b/openfl/desktop/ClipboardFormats.html index 15569f7..a37a11b 100644 --- a/openfl/desktop/ClipboardFormats.html +++ b/openfl/desktop/ClipboardFormats.html @@ -1,7 +1,7 @@ -Available on all platforms
The ClipboardFormats class defines constants for the names of the standard +
Available on all platforms
The ClipboardFormats class defines constants for the names of the standard data formats used with the Clipboard class. Flash Player 10 only supports TEXT_FORMAT, RICH_TEXT_FORMAT, and HTML_FORMAT.
@:value(cast 1)@:impl@:enuminlineread onlyRICH_TEXT_FORMAT:ClipboardFormats = 1
Rich Text Format data.
Available on all platforms
The ClipboardTransferMode class defines constants for the modes used as +
Available on all platforms
The ClipboardTransferMode class defines constants for the modes used as
values of the transferMode
parameter of the Clipboard.getData()
method.
The transfer mode provides a hint about whether to return a reference or a
diff --git a/openfl/desktop/DockIcon.html b/openfl/desktop/DockIcon.html
index 3695603..95a9f56 100644
--- a/openfl/desktop/DockIcon.html
+++ b/openfl/desktop/DockIcon.html
@@ -1,7 +1,7 @@
-
Available on AIR, Android, Flash, Linux, Neko, Windows, iOS, macOS
The DockIcon class represents the macOS-style dock icon.
+Available on AIR, Android, HashLink, Linux, Neko, Windows, iOS, macOS
The DockIcon class represents the macOS-style dock icon.
You can test for support at run time using the
NativeApplication.supportsDockIcon
property.
OpenFL target support: Not currently supported, except when targeting AIR.
@@ -178,7 +178,7 @@ for a listener that is a nested inner function, the function will be garbage-collected and no longer persistent. If you create references to the -inner function(save it in another variable) then +inner function (save it in another variable) then it is not garbage-collected and stays persistent.Weak references are supported on some OpenFL diff --git a/openfl/desktop/Icon.html b/openfl/desktop/Icon.html index 1c8d91b..6749c13 100644 --- a/openfl/desktop/Icon.html +++ b/openfl/desktop/Icon.html @@ -1,7 +1,7 @@ -
Available on AIR, Android, Flash, Linux, Neko, Windows, iOS, macOS
The Icon class represents an operating system icon.
+Available on AIR, Android, HashLink, Linux, Neko, Windows, iOS, macOS
The Icon class represents an operating system icon.
An Icon object has one property, bitmaps
, which is an array of BitmapData
objects. Only one image is displayed at a time. The operating system selects
the image closest in size to the icon's current display size, scaling if
@@ -146,7 +146,7 @@
for a listener that is a nested inner function,
the function will be garbage-collected and no
longer persistent. If you create references to the
-inner function(save it in another variable) then
+inner function (save it in another variable) then
it is not garbage-collected and stays
persistent.
Weak references are supported on some OpenFL diff --git a/openfl/desktop/InteractiveIcon.html b/openfl/desktop/InteractiveIcon.html index 44064d4..36d7aa4 100644 --- a/openfl/desktop/InteractiveIcon.html +++ b/openfl/desktop/InteractiveIcon.html @@ -1,7 +1,7 @@ -
Available on AIR, Android, Flash, Linux, Neko, Windows, iOS, macOS
The InteractiveIcon class is the base class for the operating system icons +
Available on AIR, Android, HashLink, Linux, Neko, Windows, iOS, macOS
The InteractiveIcon class is the base class for the operating system icons associated with applications.
Use the icon
property of the NativeApplication object to get an instance
of the application icon. The icon type will be one of the subclasses of
@@ -158,7 +158,7 @@
for a listener that is a nested inner function,
the function will be garbage-collected and no
longer persistent. If you create references to the
-inner function(save it in another variable) then
+inner function (save it in another variable) then
it is not garbage-collected and stays
persistent.
Weak references are supported on some OpenFL diff --git a/openfl/desktop/InvokeEventReason.html b/openfl/desktop/InvokeEventReason.html index e0adccc..206d383 100644 --- a/openfl/desktop/InvokeEventReason.html +++ b/openfl/desktop/InvokeEventReason.html @@ -1,7 +1,7 @@ -
Available on AIR, Android, Flash, Linux, Neko, Windows, iOS, macOS
The InvokeEventReason class enumerates values returned by the reason
+
Available on AIR, Android, HashLink, Linux, Neko, Windows, iOS, macOS
The InvokeEventReason class enumerates values returned by the reason
property of an InvokeEvent object.
See also:
@:value(cast 0)@:impl@:enuminlineread onlyLOGIN:InvokeEventReason = 0
Desktop only; indicates that the InvokeEvent event occurred due to the user logging in.
@:value(cast 1)@:impl@:enuminlineread onlyNOTIFICATION:InvokeEventReason = 1
iOS only; indicates that the InvokeEvent occurred because the application was invoked on receiving a remote notification.
@:value(cast 2)@:impl@:enuminlineread onlyOPEN_URL:InvokeEventReason = 2
Mobile only; indicates that the InvokeEvent occurred because the diff --git a/openfl/desktop/NativeApplication.html b/openfl/desktop/NativeApplication.html index e64e516..21e49ef 100644 --- a/openfl/desktop/NativeApplication.html +++ b/openfl/desktop/NativeApplication.html @@ -1,7 +1,7 @@ -
Available on AIR, Android, Flash, Linux, Neko, Windows, iOS, macOS
The NativeApplication class represents this OpenFL application.
+Available on AIR, Android, HashLink, Linux, Neko, Windows, iOS, macOS
The NativeApplication class represents this OpenFL application.
The NativeApplication class provides application information, application-wide functions, and dispatches application-level events.
The NativeApplication object is a singleton object, created automatically @@ -250,7 +250,7 @@ for a listener that is a nested inner function, the function will be garbage-collected and no longer persistent. If you create references to the -inner function(save it in another variable) then +inner function (save it in another variable) then it is not garbage-collected and stays persistent.
Weak references are supported on some OpenFL diff --git a/openfl/desktop/NativeProcess.html b/openfl/desktop/NativeProcess.html index 9e17ab6..522e3fd 100644 --- a/openfl/desktop/NativeProcess.html +++ b/openfl/desktop/NativeProcess.html @@ -1,7 +1,7 @@ -
Available on AIR, Android, Flash, Linux, Neko, Windows, iOS, macOS
The NativeProcess class provides command line integration and general +
Available on AIR, Android, HashLink, Linux, Neko, Windows, iOS, macOS
The NativeProcess class provides command line integration and general launching capabilities. The NativeProcess class lets an OpenFL application execute native processes on the host operating system. The OpenFL application can monitor the standard input (stdin) and standard output @@ -227,7 +227,7 @@ for a listener that is a nested inner function, the function will be garbage-collected and no longer persistent. If you create references to the -inner function(save it in another variable) then +inner function (save it in another variable) then it is not garbage-collected and stays persistent.
Weak references are supported on some OpenFL diff --git a/openfl/desktop/NativeProcessStartupInfo.html b/openfl/desktop/NativeProcessStartupInfo.html index d267806..d68767e 100644 --- a/openfl/desktop/NativeProcessStartupInfo.html +++ b/openfl/desktop/NativeProcessStartupInfo.html @@ -1,7 +1,7 @@ -
Available on AIR, Android, Flash, Linux, Neko, Windows, iOS, macOS
This class provides the basic information used to start a process on the +
Available on AIR, Android, HashLink, Linux, Neko, Windows, iOS, macOS
This class provides the basic information used to start a process on the
host operating system. It is constructed and passed to the start()
method
of a NativeProcess object.
Native process access is only available to Haxe "sys" targets and AIR diff --git a/openfl/desktop/NotificationType.html b/openfl/desktop/NotificationType.html index 988320f..ea69e2c 100644 --- a/openfl/desktop/NotificationType.html +++ b/openfl/desktop/NotificationType.html @@ -1,7 +1,7 @@ -
Available on AIR, Android, Flash, Linux, Neko, Windows, iOS, macOS
The NotificationType class defines constants for use in the priority +
Available on AIR, Android, HashLink, Linux, Neko, Windows, iOS, macOS
The NotificationType class defines constants for use in the priority
parameter of the DockIcon bounce()
method and the type parameter of the
NativeWindow notifyUser()
method.
See also:
@:value(cast 0)@:impl@:enuminlineread onlyCRITICAL:NotificationType = 0
Specifies that a notification alert is critical in nature and the user should attend to it promptly.
@:value(cast 1)@:impl@:enuminlineread onlyINFORMATIONAL:NotificationType = 1
Specifies that a notification alert is informational in nature and the diff --git a/openfl/desktop/SystemIdleMode.html b/openfl/desktop/SystemIdleMode.html index 39ca99f..ff7256e 100644 --- a/openfl/desktop/SystemIdleMode.html +++ b/openfl/desktop/SystemIdleMode.html @@ -1,7 +1,7 @@ -
Available on AIR, Android, Flash, Linux, Neko, Windows, iOS, macOS
The SystemIdleMode class provides constant values for system idle behaviors. +
Available on AIR, Android, HashLink, Linux, Neko, Windows, iOS, macOS
The SystemIdleMode class provides constant values for system idle behaviors.
These constants are used in the systemIdleMode
property of the
NativeApplication
class.
See also:
@:value(cast 0)@:impl@:enuminlineread onlyKEEP_AWAKE:SystemIdleMode = 0
Prevents the system from dropping into an idle mode.
On Android, the application must specify the Android permissions for diff --git a/openfl/desktop/SystemTrayIcon.html b/openfl/desktop/SystemTrayIcon.html index 81c6533..4afaeb9 100644 --- a/openfl/desktop/SystemTrayIcon.html +++ b/openfl/desktop/SystemTrayIcon.html @@ -1,7 +1,8 @@ -
Available on AIR, Android, Flash, Linux, Neko, Windows, iOS, macOS
@:value(63)staticfinalread onlyMAX_TIP_LENGTH:Int = 63
The permitted length of the system tray icon tooltip.
tooltip:String
The tooltip that pops up for the system tray icon. If the string is +
Available on AIR, Android, HashLink, Linux, Neko, Windows, iOS, macOS
The SystemTrayIcon class represents the Windows® taskbar notification area +(system tray)-style icon.
+OpenFL target support: Not currently supported, except when targeting AIR.
+Adobe AIR profile support: This feature is supported on desktop operating systems, +but it is not supported on mobile devices or AIR for TV devices. See +AIR Profile Support +for more information regarding API support across multiple profiles.
+Not all desktop operating systems have system tray icons. Check
+NativeApplication.supportsSystemTrayIcon
to determine whether system tray
+icons are supported on the current system.
An instance of the SystemTrayIcon class cannot be created. Get the object
+representing the system tray icon from the icon
property of the "global"
+NativeApplication object.
When system tray icons are supported, the icon will be of type
+SystemTrayIcon. Otherwise, the type of icon
will be another subclass of
+InteractiveIcon, typically DockIcon.
Important: Attempting to call a SystemTrayIcon class method on the
+NativeApplication.icon
object on an operating system for which OpenFL does
+not support system tray icons will generate a run-time exception.
@:value(63)staticfinalread onlyMAX_TIP_LENGTH:Int = 63
The permitted length of the system tray icon tooltip.
tooltip:String
The tooltip that pops up for the system tray icon. If the string is
longer than SystemTrayIcon.MAX_TIP_LENGTH
, the tip will be truncated.
@:value(0)read onlyheight:Int = 0
The current display height of the icon in pixels.
Some icon contexts support dynamic sizes. The height
property
indicates the height of the icon chosen from the bitmaps
array for the
@@ -151,7 +170,7 @@
for a listener that is a nested inner function,
the function will be garbage-collected and no
longer persistent. If you create references to the
-inner function(save it in another variable) then
+inner function (save it in another variable) then
it is not garbage-collected and stays
persistent.
Weak references are supported on some OpenFL diff --git a/openfl/desktop/Updater.html b/openfl/desktop/Updater.html index 14f7955..e8ed168 100644 --- a/openfl/desktop/Updater.html +++ b/openfl/desktop/Updater.html @@ -1,7 +1,7 @@ -
Available on AIR, Android, Flash, Linux, Neko, Windows, iOS, macOS
The Updater class is used to update the currently running application with a +
Available on AIR, Android, HashLink, Linux, Neko, Windows, iOS, macOS
The Updater class is used to update the currently running application with a
different version. To use it, instantiate an Updater object and then call
its update()
method.
You can test for support at run time using the Updater.isSupported
diff --git a/openfl/desktop/index.html b/openfl/desktop/index.html
index ca22767..b472d0d 100644
--- a/openfl/desktop/index.html
+++ b/openfl/desktop/index.html
@@ -1,7 +1,7 @@
-
.. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Clipboard | The Clipboard class provides a container for transferring data and objects + openfl.desktop
View source class AVM1Moviepackage openfl.displayextends DisplayObject › EventDispatcher@:fileXml("tags=\"haxe,release\"")@:noDebug@SuppressWarnings("checkstyle:Dynamic")Available on AIR, Flash AVM1Movie is a simple class that represents AVM1 movie clips, which use + View source class AVM1Moviepackage openfl.displayextends DisplayObject › EventDispatcher@:fileXml("tags=\"haxe,release\"")@:noDebug@SuppressWarnings("checkstyle:Dynamic")Available on AIR, Flash AVM1Movie is a simple class that represents AVM1 movie clips, which use ActionScript 1.0 or 2.0. (AVM1 is the ActionScript virtual machine used to run ActionScript 1.0 and 2.0. AVM2 is the ActionScript virtual machine used to run ActionScript 3.0.) When a Flash Player 8, or older, SWF file @@ -80,7 +80,7 @@ However, child Sprite objects, MovieClip objects, or other AVM1 SWF files loaded by this SWF file can load into this. Inherited VariablesDefined by DisplayObject
|
BlendMode Constant | Illustration | Description |
---|---|---|
BlendMode.NORMAL | The display object appears in front of the background. Pixel values of the display object override those of the background. Where the display object is transparent, the background is visible. | |
BlendMode.LAYER | Forces the creation of a transparency group for the display object. This means that the display object is pre-composed in a temporary buffer before it is processed further. This is done automatically if the display object is pre-cached using bitmap caching or if the display object is a display object container with at least one child object with a blendMode setting other than BlendMode.NORMAL . Not supported under GPU rendering. | |
BlendMode.MULTIPLY | Multiplies the values of the display object constituent colors by the colors of the background color, and then normalizes by dividing by 0xFF, resulting in darker colors. This setting is commonly used for shadows and depth effects. For example, if a constituent color (such as red) of one pixel in the display object and the corresponding color of the pixel in the background both have the value 0x88, the multiplied result is 0x4840. Dividing by 0xFF yields a value of 0x48 for that constituent color, which is a darker shade than the color of the display object or the color of the background. | |
BlendMode.SCREEN | Multiplies the complement (inverse) of the display object color by the complement of the background color, resulting in a bleaching effect. This setting is commonly used for highlights or to remove black areas of the display object. | |
BlendMode.LIGHTEN | Selects the lighter of the constituent colors of the display object and the color of the background (the colors with the larger values). This setting is commonly used for superimposing type. For example, if the display object has a pixel with an RGB value of 0xFFCC33, and the background pixel has an RGB value of 0xDDF800, the resulting RGB value for the displayed pixel is 0xFFF833 (because 0xFF > 0xDD, 0xCC < 0xF8, and 0x33 > 0x00 = 33). Not supported under GPU rendering. | |
BlendMode.DARKEN | Selects the darker of the constituent colors of the display object and the colors of the background (the colors with the smaller values). This setting is commonly used for superimposing type. For example, if the display object has a pixel with an RGB value of 0xFFCC33, and the background pixel has an RGB value of 0xDDF800, the resulting RGB value for the displayed pixel is 0xDDCC00 (because 0xFF > 0xDD, 0xCC < 0xF8, and 0x33 > 0x00 = 33). Not supported under GPU rendering. | |
BlendMode.DIFFERENCE | Compares the constituent colors of the display object with the colors of its background, and subtracts the darker of the values of the two constituent colors from the lighter value. This setting is commonly used for more vibrant colors. For example, if the display object has a pixel with an RGB value of 0xFFCC33, and the background pixel has an RGB value of 0xDDF800, the resulting RGB value for the displayed pixel is 0x222C33 (because 0xFF - 0xDD = 0x22, 0xF8 - 0xCC = 0x2C, and 0x33 - 0x00 = 0x33). | |
BlendMode.ADD | Adds the values of the constituent colors of the display object to the colors of its background, applying a ceiling of 0xFF. This setting is commonly used for animating a lightening dissolve between two objects. For example, if the display object has a pixel with an RGB value of 0xAAA633, and the background pixel has an RGB value of 0xDD2200, the resulting RGB value for the displayed pixel is 0xFFC833 (because 0xAA + 0xDD > 0xFF, 0xA6 + 0x22 = 0xC8, and 0x33 + 0x00 = 0x33). | |
BlendMode.SUBTRACT | Subtracts the values of the constituent colors in the display object from the values of the background color, applying a floor of 0. This setting is commonly used for animating a darkening dissolve between two objects. For example, if the display object has a pixel with an RGB value of 0xAA2233, and the background pixel has an RGB value of 0xDDA600, the resulting RGB value for the displayed pixel is 0x338400 (because 0xDD - 0xAA = 0x33, 0xA6 - 0x22 = 0x84, and 0x00 - 0x33 < 0x00). | |
BlendMode.INVERT | Inverts the background. | |
BlendMode.ALPHA | Applies the alpha value of each pixel of the display object to the background. This requires the blendMode setting of the parent display object to be set to BlendMode.LAYER . For example, in the illustration, the parent display object, which is a white background, has blendMode = BlendMode.LAYER . Not supported under GPU rendering. | |
BlendMode.ERASE | Erases the background based on the alpha value of the display object. This requires the blendMode of the parent display object to be set to BlendMode.LAYER . For example, in the illustration, the parent display object, which is a white background, has blendMode = BlendMode.LAYER . Not supported under GPU rendering. | |
BlendMode.OVERLAY | Adjusts the color of each pixel based on the darkness of the background. If the background is lighter than 50% gray, the display object and background colors are screened, which results in a lighter color. If the background is darker than 50% gray, the colors are multiplied, which results in a darker color. This setting is commonly used for shading effects. Not supported under GPU rendering. | |
BlendMode.HARDLIGHT | Adjusts the color of each pixel based on the darkness of the display object. If the display object is lighter than 50% gray, the display object and background colors are screened, which results in a lighter color. If the display object is darker than 50% gray, the colors are multiplied, which results in a darker color. This setting is commonly used for shading effects. Not supported under GPU rendering. | |
BlendMode.SHADER | N/A | Adjusts the color using a custom shader routine. The shader that is used is specified as the Shader instance assigned to the blendShader property. Setting the blendShader property of a display object to a Shader instance automatically sets the display object's blendMode property to BlendMode.SHADER . If the blendMode property is set to BlendMode.SHADER without first setting the blendShader property, the blendMode property is set to BlendMode.NORMAL . Not supported under GPU rendering. |
cacheAsBitmap:Bool
All vector data for a display object that has a cached bitmap is drawn +
BlendMode Constant | Illustration | Description |
---|---|---|
BlendMode.NORMAL | The display object appears in front of the background. Pixel values of the display object override those of the background. Where the display object is transparent, the background is visible. | |
BlendMode.LAYER | Forces the creation of a transparency group for the display object. This means that the display object is pre-composed in a temporary buffer before it is processed further. This is done automatically if the display object is pre-cached using bitmap caching or if the display object is a display object container with at least one child object with a blendMode setting other than BlendMode.NORMAL . Not supported under GPU rendering. | |
BlendMode.MULTIPLY | Multiplies the values of the display object constituent colors by the colors of the background color, and then normalizes by dividing by 0xFF, resulting in darker colors. This setting is commonly used for shadows and depth effects. For example, if a constituent color (such as red) of one pixel in the display object and the corresponding color of the pixel in the background both have the value 0x88, the multiplied result is 0x4840. Dividing by 0xFF yields a value of 0x48 for that constituent color, which is a darker shade than the color of the display object or the color of the background. | |
BlendMode.SCREEN | Multiplies the complement (inverse) of the display object color by the complement of the background color, resulting in a bleaching effect. This setting is commonly used for highlights or to remove black areas of the display object. | |
BlendMode.LIGHTEN | Selects the lighter of the constituent colors of the display object and the color of the background (the colors with the larger values). This setting is commonly used for superimposing type. For example, if the display object has a pixel with an RGB value of 0xFFCC33, and the background pixel has an RGB value of 0xDDF800, the resulting RGB value for the displayed pixel is 0xFFF833 (because 0xFF > 0xDD, 0xCC < 0xF8, and 0x33 > 0x00 = 33). Not supported under GPU rendering. | |
BlendMode.DARKEN | Selects the darker of the constituent colors of the display object and the colors of the background (the colors with the smaller values). This setting is commonly used for superimposing type. For example, if the display object has a pixel with an RGB value of 0xFFCC33, and the background pixel has an RGB value of 0xDDF800, the resulting RGB value for the displayed pixel is 0xDDCC00 (because 0xFF > 0xDD, 0xCC < 0xF8, and 0x33 > 0x00 = 33). Not supported under GPU rendering. | |
BlendMode.DIFFERENCE | Compares the constituent colors of the display object with the colors of its background, and subtracts the darker of the values of the two constituent colors from the lighter value. This setting is commonly used for more vibrant colors. For example, if the display object has a pixel with an RGB value of 0xFFCC33, and the background pixel has an RGB value of 0xDDF800, the resulting RGB value for the displayed pixel is 0x222C33 (because 0xFF - 0xDD = 0x22, 0xF8 - 0xCC = 0x2C, and 0x33 - 0x00 = 0x33). | |
BlendMode.ADD | Adds the values of the constituent colors of the display object to the colors of its background, applying a ceiling of 0xFF. This setting is commonly used for animating a lightening dissolve between two objects. For example, if the display object has a pixel with an RGB value of 0xAAA633, and the background pixel has an RGB value of 0xDD2200, the resulting RGB value for the displayed pixel is 0xFFC833 (because 0xAA + 0xDD > 0xFF, 0xA6 + 0x22 = 0xC8, and 0x33 + 0x00 = 0x33). | |
BlendMode.SUBTRACT | Subtracts the values of the constituent colors in the display object from the values of the background color, applying a floor of 0. This setting is commonly used for animating a darkening dissolve between two objects. For example, if the display object has a pixel with an RGB value of 0xAA2233, and the background pixel has an RGB value of 0xDDA600, the resulting RGB value for the displayed pixel is 0x338400 (because 0xDD - 0xAA = 0x33, 0xA6 - 0x22 = 0x84, and 0x00 - 0x33 < 0x00). | |
BlendMode.INVERT | Inverts the background. | |
BlendMode.ALPHA | Applies the alpha value of each pixel of the display object to the background. This requires the blendMode setting of the parent display object to be set to BlendMode.LAYER . For example, in the illustration, the parent display object, which is a white background, has blendMode = BlendMode.LAYER . Not supported under GPU rendering. | |
BlendMode.ERASE | Erases the background based on the alpha value of the display object. This requires the blendMode of the parent display object to be set to BlendMode.LAYER . For example, in the illustration, the parent display object, which is a white background, has blendMode = BlendMode.LAYER . Not supported under GPU rendering. | |
BlendMode.OVERLAY | Adjusts the color of each pixel based on the darkness of the background. If the background is lighter than 50% gray, the display object and background colors are screened, which results in a lighter color. If the background is darker than 50% gray, the colors are multiplied, which results in a darker color. This setting is commonly used for shading effects. Not supported under GPU rendering. | |
BlendMode.HARDLIGHT | Adjusts the color of each pixel based on the darkness of the display object. If the display object is lighter than 50% gray, the display object and background colors are screened, which results in a lighter color. If the display object is darker than 50% gray, the colors are multiplied, which results in a darker color. This setting is commonly used for shading effects. Not supported under GPU rendering. | |
BlendMode.SHADER | N/A | Adjusts the color using a custom shader routine. The shader that is used is specified as the Shader instance assigned to the blendShader property. Setting the blendShader property of a display object to a Shader instance automatically sets the display object's blendMode property to BlendMode.SHADER . If the blendMode property is set to BlendMode.SHADER without first setting the blendShader property, the blendMode property is set to BlendMode.NORMAL . Not supported under GPU rendering. |
See also:
cacheAsBitmap:Bool
All vector data for a display object that has a cached bitmap is drawn
to the bitmap instead of the main display. If
cacheAsBitmapMatrix
is null or unsupported, the bitmap is
then copied to the main display as unstretched, unrotated pixels snapped
@@ -131,12 +131,12 @@
number of pixels cannot exceed 16,777,215 pixels.(So, if a bitmap image
is 8,191 pixels wide, it can only be 2,048 pixels high.) In Flash Player 9
and earlier, the limitation is is 2880 pixels in height and 2,880 pixels
-in width.
The cacheAsBitmap
property is best used with movie clips
that have mostly static content and that do not scale and rotate
frequently. With such movie clips, cacheAsBitmap
can lead to
-performance increases when the movie clip is translated(when its x
-and y position is changed).
cacheAsBitmapMatrix:Matrix
If non-null, this Matrix object defines how a display object is rendered when cacheAsBitmap
is set to
+performance increases when the movie clip is translated (when its x
+and y position is changed).
See also:
cacheAsBitmapMatrix:Matrix
If non-null, this Matrix object defines how a display object is rendered when cacheAsBitmap
is set to
true
. The application uses this matrix as a transformation matrix that is applied when rendering the
bitmap version of the display object.
Adobe AIR profile support: This feature is supported on mobile devices, but it is not supported on desktop @@ -170,16 +170,16 @@
Note: The cacheAsBitmapMatrix
property is suitable for 2D transformations. If you need to apply
transformations in 3D, you may do so by setting a 3D property of the object and manipulating its
transform.matrix3D
property. If the application is packaged using GPU mode, this allows the 3D transforms
-to be applied to the object by the GPU. The cacheAsBitmapMatrix
is ignored for 3D objects.
filters:Array<BitmapFilter>
An indexed array that contains each filter object currently associated
+to be applied to the object by the GPU. The cacheAsBitmapMatrix
is ignored for 3D objects.
See also:
filters:Array<BitmapFilter>
An indexed array that contains each filter object currently associated with the display object. The openfl.filters package contains several classes that define specific filters you can use.
Filters can be applied in Flash Professional at design time, or at run
-time by using ActionScript code. To apply a filter by using ActionScript,
+time by using Haxe code. To apply a filter by using Haxe,
you must make a temporary copy of the entire filters
array,
modify the temporary array, then assign the value of the temporary array
back to the filters
array. You cannot directly add a new
filter object to the filters
array.
To add a filter by using ActionScript, perform the following steps +
To add a filter by using Haxe, perform the following steps
(assume that the target display object is named
myDisplayObject
):
myDisplayObject.filters
array
@@ -210,7 +210,7 @@
The openfl.filters package includes classes for filters. For example, to create a DropShadow filter, you would write:
Throws:
ArgumentError | When | ||||
---|---|---|---|---|---|
ArgumentError | When | ||||
ArgumentError | When Except for TextField and Video objects, a display object with no
content(such as an empty sprite) has a height of 0, even if you try to
-set
|
IllegalOperationError | If you are attempting to set this property on an object that was placed on the timeline in the Flash authoring tool. |
---|
opaqueBackground:Null<Int>
Specifies whether the display object is opaque with a certain background color. A transparent bitmap contains alpha channel data and is drawn -transparently. An opaque bitmap has no alpha channel(and renders faster +transparently. An opaque bitmap has no alpha channel (and renders faster than a transparent bitmap). If the bitmap is opaque, you specify its own background color to use.
-If set to a number value, the surface is opaque(not transparent) with +
If set to a number value, the surface is opaque (not transparent) with
the RGB background color that the number specifies. If set to
null
(the default value), the display object has a
transparent background.
The opaque background region is not matched when calling the
hitTestPoint()
method with the shapeFlag
parameter set to true
.
The opaque background region does not respond to mouse events.
read onlyparent:DisplayObjectContainer
Indicates the DisplayObjectContainer object that contains this display +
The opaque background region does not respond to mouse events.
See also:
read onlyparent:DisplayObjectContainer
Indicates the DisplayObjectContainer object that contains this display
object. Use the parent
property to specify a relative path to
display objects that are above the current display object in the display
list hierarchy.
this.parent.parent.alpha = 20;
Throws:
SecurityError | The parent display object belongs to a security
sandbox to which you do not have access. You can
avoid this situation by having the parent movie call
-the |
---|
read onlyroot:DisplayObject
For a display object in a loaded SWF file, the root
property
+the Security.allowDomain()
method.
See also:
read onlyroot:DisplayObject
For a display object in a loaded SWF file, the root
property
is the top-most display object in the portion of the display list's tree
structure represented by that SWF file. For a Bitmap object representing a
loaded image file, the root
property is the Bitmap object
@@ -312,7 +312,7 @@
is a child of the top-most display object in a loaded SWF file.
For example, if you create a new Sprite object by calling the
Sprite()
constructor method, its root
property
-is null
until you add it to the display list(or to a display
+is null
until you add it to the display list (or to a display
object container that is off the display list but that is a child of the
top-most display object in a SWF file).
For a loaded SWF file, even though the Loader object used to load the
@@ -320,12 +320,12 @@
SWF file has its root
property set to itself. The Loader
object does not have its root
property set until it is added
as a child of a display object for which the root
property is
-set.
@:keeprotation:Float
Indicates the rotation of the DisplayObject instance, in degrees, from its +set.
See also:
@:keeprotation:Float
Indicates the rotation of the DisplayObject instance, in degrees, from its
original orientation. Values from 0 to 180 represent clockwise rotation;
values from 0 to -180 represent counterclockwise rotation. Values outside
this range are added to or subtracted from 360 to obtain a value within
the range. For example, the statement my_video.rotation = 450
-is the same as my_video.rotation = 90
.
scale9Grid:Rectangle
The current scaling grid that is in effect. If set to null
,
+is the same as my_video.rotation = 90
.
See also:
scale9Grid:Rectangle
The current scaling grid that is in effect. If set to null
,
the entire display object is scaled normally when any scale transformation
is applied.
When you define the scale9Grid
property, the display
@@ -353,11 +353,11 @@
the registration point. The default registration point is (0,0). 1.0
equals 100% scale.
Scaling the local coordinate system changes the x
and
-y
property values, which are defined in whole pixels.
@:keepscaleY:Float
Indicates the vertical scale (percentage) of an object as applied from the
+y
property values, which are defined in whole pixels.
See also:
@:keepscaleY:Float
Indicates the vertical scale (percentage) of an object as applied from the registration point of the object. The default registration point is (0,0). 1.0 is 100% scale.
Scaling the local coordinate system changes the x
and
-y
property values, which are defined in whole pixels.
scrollRect:Rectangle
The scroll rectangle bounds of the display object. The display object is
+y
property values, which are defined in whole pixels.
See also:
scrollRect:Rectangle
The scroll rectangle bounds of the display object. The display object is
cropped to the size defined by the rectangle, and it scrolls within the
rectangle when you change the x
and y
properties
of the scrollRect
object.
y
property of the
scrollRect
Rectangle object. If the display object is rotated
90° and you scroll it left and right, the display object actually scrolls
-up and down.@:betashader:Shader
BETA**
Applies a custom Shader object to use when rendering this display object (or its children) when using
hardware rendering. This occurs as a single-pass render on this object only, if visible. In order to
apply a post-process effect to multiple display objects at once, enable cacheAsBitmap
or use the
filters
property with a ShaderFilter
read onlystage:Stage
The Stage of the display object. A Flash runtime application has only one
Stage object. For example, you can create and load multiple display
objects into the display list, and the stage
property of each
-display object refers to the same Stage object(even if the display object
+display object refers to the same Stage object (even if the display object
belongs to a loaded SWF file).
If a display object is not added to the display list, its
-stage
property is set to null
.
@:keeptransform:Transform
An object with properties pertaining to a display object's matrix, color
+stage
property is set to null
.
See also:
@:keeptransform:Transform
An object with properties pertaining to a display object's matrix, color
transform, and pixel bounds. The specific properties - matrix,
colorTransform, and three read-only properties
(concatenatedMatrix
, concatenatedColorTransform
,
@@ -421,21 +421,21 @@
is adjusted accordingly, as shown in the following code:
Except for TextField and Video objects, a display object with no
content(such as an empty sprite) has a width of 0, even if you try to set
-width
to a different value.
@:keepx:Float
Indicates the x coordinate of the DisplayObject instance relative
+width
to a different value.
See also:
@:keepx:Float
Indicates the x coordinate of the DisplayObject instance relative to the local coordinates of the parent DisplayObjectContainer. If the object is inside a DisplayObjectContainer that has transformations, it is in the local coordinate system of the enclosing DisplayObjectContainer. Thus, for a DisplayObjectContainer rotated 90° counterclockwise, the DisplayObjectContainer's children inherit a coordinate system that is rotated 90° counterclockwise. The object's coordinates refer to the -registration point position.
@:keepy:Float
Indicates the y coordinate of the DisplayObject instance relative +registration point position.
See also:
@:keepy:Float
Indicates the y coordinate of the DisplayObject instance relative to the local coordinates of the parent DisplayObjectContainer. If the object is inside a DisplayObjectContainer that has transformations, it is in the local coordinate system of the enclosing DisplayObjectContainer. Thus, for a DisplayObjectContainer rotated 90° counterclockwise, the DisplayObjectContainer's children inherit a coordinate system that is rotated 90° counterclockwise. The object's coordinates refer to the -registration point position.
getBounds(targetCoordinateSpace:DisplayObject):Rectangle
Returns a rectangle that defines the area of the display object relative +registration point position.
See also:
getBounds(targetCoordinateSpace:DisplayObject):Rectangle
Returns a rectangle that defines the area of the display object relative
to the coordinate system of the targetCoordinateSpace
object.
Consider the following code, which shows how the rectangle returned can
vary depending on the targetCoordinateSpace
parameter that
@@ -462,8 +462,8 @@
coordinates, respectively.
Parameters:
targetCoordinateSpace | The display object that defines the coordinate system to use. |
---|
Returns:
The rectangle that defines the area of the display object relative
to the targetCoordinateSpace
object's coordinate
-system.
globalToLocal(pos:Point):Point
Converts the point
object from the Stage(global) coordinates
-to the display object's(local) coordinates.
globalToLocal(pos:Point):Point
Converts the point
object from the Stage (global) coordinates
+to the display object's (local) coordinates.
To use this method, first create an instance of the Point class. The
x and y values that you assign represent global coordinates
because they relate to the origin(0,0) of the main display area. Then
@@ -478,17 +478,17 @@
point specified by the x
and y
parameters. The
x
and y
parameters specify a point in the
coordinate space of the Stage, not the display object container that
-contains the display object(unless that display object container is the
+contains the display object (unless that display object container is the
Stage).
Parameters:
x | The x coordinate to test against this object. |
---|---|
y | The y coordinate to test against this object. |
shapeFlag | Whether to check against the actual pixels of the object
( |
Returns:
true
if the display object overlaps or intersects
with the specified point; false
otherwise.
invalidate():Void
Calling the invalidate()
method signals to have the current object
-redrawn the next time the object is eligible to be rendered.
localToGlobal(point:Point):Point
Converts the point
object from the display object's(local)
-coordinates to the Stage(global) coordinates.
localToGlobal(point:Point):Point
Converts the point
object from the display object's (local)
+coordinates to the Stage (global) coordinates.
This method allows you to convert any given x and y coordinates from values that are relative to the origin(0,0) of a -specific display object(local coordinates) to values that are relative to -the origin of the Stage(global coordinates).
+specific display object (local coordinates) to values that are relative to +the origin of the Stage (global coordinates).To use this method, first create an instance of the Point class. The x and y values that you assign represent local coordinates because they relate to the origin of the display object.
diff --git a/openfl/display/Application.html b/openfl/display/Application.html index 692b631..3ebf919 100644 --- a/openfl/display/Application.html +++ b/openfl/display/Application.html @@ -1,7 +1,7 @@ -Available on all platforms
The Application class is a Lime Application instance that uses +
Available on all platforms
The Application class is a Lime Application instance that uses OpenFL Window by default when a new window is created.
Available on all platforms
The Bitmap class represents display objects that represent bitmap images. +
Available on all platforms
The Bitmap class represents display objects that represent bitmap images.
These can be images that you load with the openfl.Assets
or
openfl.display.Loader
classes, or they can be images that you
create with the Bitmap()
constructor.
Note: The Bitmap class is not a subclass of the InteractiveObject
class, so it cannot dispatch mouse events. However, you can use the
addEventListener()
method of the display object container that
-contains the Bitmap object.
@:value({ smoothing : false, pixelSnapping : null, bitmapData : null })new(?bitmapData:BitmapData, ?pixelSnapping:PixelSnapping, smoothing:Bool = false)
Initializes a Bitmap object to refer to the specified BitmapData object.
Parameters:
bitmapData | The BitmapData object being referenced. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
pixelSnapping | Whether or not the Bitmap object is snapped to the nearest pixel. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
smoothing | Whether or not the bitmap is smoothed when scaled. For example, the following examples +contains the Bitmap object. See also: Constructor
|
bitmapData | The BitmapData object being referenced. |
---|---|
pixelSnapping | Whether or not the Bitmap object is snapped to the nearest pixel. |
smoothing | Whether or not the bitmap is smoothed when scaled. For example, the following examples
show the same bitmap scaled by a factor of 3, with |
pixelSnapping:PixelSnapping
Controls whether or not the Bitmap object is snapped to the nearest pixel.
This value is ignored in the native and HTML5 targets.
@@ -93,7 +93,7 @@
true
, the bitmap is smoothed when scaled. If
false
, the bitmap is not smoothed when scaled.
@:keepalpha:Float
Indicates the alpha transparency value of the object specified. Valid
values are 0 (fully transparent) to 1 (fully opaque). The default value is 1.
-Display objects with alpha
set to 0 are active, even though they are invisible.
blendMode:BlendMode
A value from the BlendMode class that specifies which blend mode to use. A
+Display objects with alpha
set to 0 are active, even though they are invisible.
See also:
blendMode:BlendMode
A value from the BlendMode class that specifies which blend mode to use. A
bitmap can be drawn internally in two ways. If you have a blend mode
enabled or an external clipping mask, the bitmap is drawn by adding a
bitmap-filled square shape to the vector render. If you attempt to set
@@ -113,7 +113,7 @@
BlendMode class defines string values you can use. The illustrations in
the table show blendMode
values applied to a circular display
object(2) superimposed on another display object(1).
BlendMode Constant | Illustration | Description |
---|---|---|
BlendMode.NORMAL | The display object appears in front of the background. Pixel values of the display object override those of the background. Where the display object is transparent, the background is visible. | |
BlendMode.LAYER | Forces the creation of a transparency group for the display object. This means that the display object is pre-composed in a temporary buffer before it is processed further. This is done automatically if the display object is pre-cached using bitmap caching or if the display object is a display object container with at least one child object with a blendMode setting other than BlendMode.NORMAL . Not supported under GPU rendering. | |
BlendMode.MULTIPLY | Multiplies the values of the display object constituent colors by the colors of the background color, and then normalizes by dividing by 0xFF, resulting in darker colors. This setting is commonly used for shadows and depth effects. For example, if a constituent color (such as red) of one pixel in the display object and the corresponding color of the pixel in the background both have the value 0x88, the multiplied result is 0x4840. Dividing by 0xFF yields a value of 0x48 for that constituent color, which is a darker shade than the color of the display object or the color of the background. | |
BlendMode.SCREEN | Multiplies the complement (inverse) of the display object color by the complement of the background color, resulting in a bleaching effect. This setting is commonly used for highlights or to remove black areas of the display object. | |
BlendMode.LIGHTEN | Selects the lighter of the constituent colors of the display object and the color of the background (the colors with the larger values). This setting is commonly used for superimposing type. For example, if the display object has a pixel with an RGB value of 0xFFCC33, and the background pixel has an RGB value of 0xDDF800, the resulting RGB value for the displayed pixel is 0xFFF833 (because 0xFF > 0xDD, 0xCC < 0xF8, and 0x33 > 0x00 = 33). Not supported under GPU rendering. | |
BlendMode.DARKEN | Selects the darker of the constituent colors of the display object and the colors of the background (the colors with the smaller values). This setting is commonly used for superimposing type. For example, if the display object has a pixel with an RGB value of 0xFFCC33, and the background pixel has an RGB value of 0xDDF800, the resulting RGB value for the displayed pixel is 0xDDCC00 (because 0xFF > 0xDD, 0xCC < 0xF8, and 0x33 > 0x00 = 33). Not supported under GPU rendering. | |
BlendMode.DIFFERENCE | Compares the constituent colors of the display object with the colors of its background, and subtracts the darker of the values of the two constituent colors from the lighter value. This setting is commonly used for more vibrant colors. For example, if the display object has a pixel with an RGB value of 0xFFCC33, and the background pixel has an RGB value of 0xDDF800, the resulting RGB value for the displayed pixel is 0x222C33 (because 0xFF - 0xDD = 0x22, 0xF8 - 0xCC = 0x2C, and 0x33 - 0x00 = 0x33). | |
BlendMode.ADD | Adds the values of the constituent colors of the display object to the colors of its background, applying a ceiling of 0xFF. This setting is commonly used for animating a lightening dissolve between two objects. For example, if the display object has a pixel with an RGB value of 0xAAA633, and the background pixel has an RGB value of 0xDD2200, the resulting RGB value for the displayed pixel is 0xFFC833 (because 0xAA + 0xDD > 0xFF, 0xA6 + 0x22 = 0xC8, and 0x33 + 0x00 = 0x33). | |
BlendMode.SUBTRACT | Subtracts the values of the constituent colors in the display object from the values of the background color, applying a floor of 0. This setting is commonly used for animating a darkening dissolve between two objects. For example, if the display object has a pixel with an RGB value of 0xAA2233, and the background pixel has an RGB value of 0xDDA600, the resulting RGB value for the displayed pixel is 0x338400 (because 0xDD - 0xAA = 0x33, 0xA6 - 0x22 = 0x84, and 0x00 - 0x33 < 0x00). | |
BlendMode.INVERT | Inverts the background. | |
BlendMode.ALPHA | Applies the alpha value of each pixel of the display object to the background. This requires the blendMode setting of the parent display object to be set to BlendMode.LAYER . For example, in the illustration, the parent display object, which is a white background, has blendMode = BlendMode.LAYER . Not supported under GPU rendering. | |
BlendMode.ERASE | Erases the background based on the alpha value of the display object. This requires the blendMode of the parent display object to be set to BlendMode.LAYER . For example, in the illustration, the parent display object, which is a white background, has blendMode = BlendMode.LAYER . Not supported under GPU rendering. | |
BlendMode.OVERLAY | Adjusts the color of each pixel based on the darkness of the background. If the background is lighter than 50% gray, the display object and background colors are screened, which results in a lighter color. If the background is darker than 50% gray, the colors are multiplied, which results in a darker color. This setting is commonly used for shading effects. Not supported under GPU rendering. | |
BlendMode.HARDLIGHT | Adjusts the color of each pixel based on the darkness of the display object. If the display object is lighter than 50% gray, the display object and background colors are screened, which results in a lighter color. If the display object is darker than 50% gray, the colors are multiplied, which results in a darker color. This setting is commonly used for shading effects. Not supported under GPU rendering. | |
BlendMode.SHADER | N/A | Adjusts the color using a custom shader routine. The shader that is used is specified as the Shader instance assigned to the blendShader property. Setting the blendShader property of a display object to a Shader instance automatically sets the display object's blendMode property to BlendMode.SHADER . If the blendMode property is set to BlendMode.SHADER without first setting the blendShader property, the blendMode property is set to BlendMode.NORMAL . Not supported under GPU rendering. |
cacheAsBitmap:Bool
All vector data for a display object that has a cached bitmap is drawn +
BlendMode Constant | Illustration | Description |
---|---|---|
BlendMode.NORMAL | The display object appears in front of the background. Pixel values of the display object override those of the background. Where the display object is transparent, the background is visible. | |
BlendMode.LAYER | Forces the creation of a transparency group for the display object. This means that the display object is pre-composed in a temporary buffer before it is processed further. This is done automatically if the display object is pre-cached using bitmap caching or if the display object is a display object container with at least one child object with a blendMode setting other than BlendMode.NORMAL . Not supported under GPU rendering. | |
BlendMode.MULTIPLY | Multiplies the values of the display object constituent colors by the colors of the background color, and then normalizes by dividing by 0xFF, resulting in darker colors. This setting is commonly used for shadows and depth effects. For example, if a constituent color (such as red) of one pixel in the display object and the corresponding color of the pixel in the background both have the value 0x88, the multiplied result is 0x4840. Dividing by 0xFF yields a value of 0x48 for that constituent color, which is a darker shade than the color of the display object or the color of the background. | |
BlendMode.SCREEN | Multiplies the complement (inverse) of the display object color by the complement of the background color, resulting in a bleaching effect. This setting is commonly used for highlights or to remove black areas of the display object. | |
BlendMode.LIGHTEN | Selects the lighter of the constituent colors of the display object and the color of the background (the colors with the larger values). This setting is commonly used for superimposing type. For example, if the display object has a pixel with an RGB value of 0xFFCC33, and the background pixel has an RGB value of 0xDDF800, the resulting RGB value for the displayed pixel is 0xFFF833 (because 0xFF > 0xDD, 0xCC < 0xF8, and 0x33 > 0x00 = 33). Not supported under GPU rendering. | |
BlendMode.DARKEN | Selects the darker of the constituent colors of the display object and the colors of the background (the colors with the smaller values). This setting is commonly used for superimposing type. For example, if the display object has a pixel with an RGB value of 0xFFCC33, and the background pixel has an RGB value of 0xDDF800, the resulting RGB value for the displayed pixel is 0xDDCC00 (because 0xFF > 0xDD, 0xCC < 0xF8, and 0x33 > 0x00 = 33). Not supported under GPU rendering. | |
BlendMode.DIFFERENCE | Compares the constituent colors of the display object with the colors of its background, and subtracts the darker of the values of the two constituent colors from the lighter value. This setting is commonly used for more vibrant colors. For example, if the display object has a pixel with an RGB value of 0xFFCC33, and the background pixel has an RGB value of 0xDDF800, the resulting RGB value for the displayed pixel is 0x222C33 (because 0xFF - 0xDD = 0x22, 0xF8 - 0xCC = 0x2C, and 0x33 - 0x00 = 0x33). | |
BlendMode.ADD | Adds the values of the constituent colors of the display object to the colors of its background, applying a ceiling of 0xFF. This setting is commonly used for animating a lightening dissolve between two objects. For example, if the display object has a pixel with an RGB value of 0xAAA633, and the background pixel has an RGB value of 0xDD2200, the resulting RGB value for the displayed pixel is 0xFFC833 (because 0xAA + 0xDD > 0xFF, 0xA6 + 0x22 = 0xC8, and 0x33 + 0x00 = 0x33). | |
BlendMode.SUBTRACT | Subtracts the values of the constituent colors in the display object from the values of the background color, applying a floor of 0. This setting is commonly used for animating a darkening dissolve between two objects. For example, if the display object has a pixel with an RGB value of 0xAA2233, and the background pixel has an RGB value of 0xDDA600, the resulting RGB value for the displayed pixel is 0x338400 (because 0xDD - 0xAA = 0x33, 0xA6 - 0x22 = 0x84, and 0x00 - 0x33 < 0x00). | |
BlendMode.INVERT | Inverts the background. | |
BlendMode.ALPHA | Applies the alpha value of each pixel of the display object to the background. This requires the blendMode setting of the parent display object to be set to BlendMode.LAYER . For example, in the illustration, the parent display object, which is a white background, has blendMode = BlendMode.LAYER . Not supported under GPU rendering. | |
BlendMode.ERASE | Erases the background based on the alpha value of the display object. This requires the blendMode of the parent display object to be set to BlendMode.LAYER . For example, in the illustration, the parent display object, which is a white background, has blendMode = BlendMode.LAYER . Not supported under GPU rendering. | |
BlendMode.OVERLAY | Adjusts the color of each pixel based on the darkness of the background. If the background is lighter than 50% gray, the display object and background colors are screened, which results in a lighter color. If the background is darker than 50% gray, the colors are multiplied, which results in a darker color. This setting is commonly used for shading effects. Not supported under GPU rendering. | |
BlendMode.HARDLIGHT | Adjusts the color of each pixel based on the darkness of the display object. If the display object is lighter than 50% gray, the display object and background colors are screened, which results in a lighter color. If the display object is darker than 50% gray, the colors are multiplied, which results in a darker color. This setting is commonly used for shading effects. Not supported under GPU rendering. | |
BlendMode.SHADER | N/A | Adjusts the color using a custom shader routine. The shader that is used is specified as the Shader instance assigned to the blendShader property. Setting the blendShader property of a display object to a Shader instance automatically sets the display object's blendMode property to BlendMode.SHADER . If the blendMode property is set to BlendMode.SHADER without first setting the blendShader property, the blendMode property is set to BlendMode.NORMAL . Not supported under GPU rendering. |
See also:
cacheAsBitmap:Bool
All vector data for a display object that has a cached bitmap is drawn
to the bitmap instead of the main display. If
cacheAsBitmapMatrix
is null or unsupported, the bitmap is
then copied to the main display as unstretched, unrotated pixels snapped
@@ -144,12 +144,12 @@
number of pixels cannot exceed 16,777,215 pixels.(So, if a bitmap image
is 8,191 pixels wide, it can only be 2,048 pixels high.) In Flash Player 9
and earlier, the limitation is is 2880 pixels in height and 2,880 pixels
-in width.
The cacheAsBitmap
property is best used with movie clips
that have mostly static content and that do not scale and rotate
frequently. With such movie clips, cacheAsBitmap
can lead to
-performance increases when the movie clip is translated(when its x
-and y position is changed).
cacheAsBitmapMatrix:Matrix
If non-null, this Matrix object defines how a display object is rendered when cacheAsBitmap
is set to
+performance increases when the movie clip is translated (when its x
+and y position is changed).
See also:
cacheAsBitmapMatrix:Matrix
If non-null, this Matrix object defines how a display object is rendered when cacheAsBitmap
is set to
true
. The application uses this matrix as a transformation matrix that is applied when rendering the
bitmap version of the display object.
Adobe AIR profile support: This feature is supported on mobile devices, but it is not supported on desktop @@ -183,16 +183,16 @@
Note: The cacheAsBitmapMatrix
property is suitable for 2D transformations. If you need to apply
transformations in 3D, you may do so by setting a 3D property of the object and manipulating its
transform.matrix3D
property. If the application is packaged using GPU mode, this allows the 3D transforms
-to be applied to the object by the GPU. The cacheAsBitmapMatrix
is ignored for 3D objects.
filters:Array<BitmapFilter>
An indexed array that contains each filter object currently associated
+to be applied to the object by the GPU. The cacheAsBitmapMatrix
is ignored for 3D objects.
See also:
filters:Array<BitmapFilter>
An indexed array that contains each filter object currently associated with the display object. The openfl.filters package contains several classes that define specific filters you can use.
Filters can be applied in Flash Professional at design time, or at run
-time by using ActionScript code. To apply a filter by using ActionScript,
+time by using Haxe code. To apply a filter by using Haxe,
you must make a temporary copy of the entire filters
array,
modify the temporary array, then assign the value of the temporary array
back to the filters
array. You cannot directly add a new
filter object to the filters
array.
To add a filter by using ActionScript, perform the following steps +
To add a filter by using Haxe, perform the following steps
(assume that the target display object is named
myDisplayObject
):
myDisplayObject.filters
array
@@ -223,7 +223,7 @@
The openfl.filters package includes classes for filters. For example, to create a DropShadow filter, you would write:
Throws:
ArgumentError | When | ||||
---|---|---|---|---|---|
ArgumentError | When | ||||
ArgumentError | When Except for TextField and Video objects, a display object with no
content(such as an empty sprite) has a height of 0, even if you try to
-set
|
IllegalOperationError | If you are attempting to set this property on an object that was placed on the timeline in the Flash authoring tool. |
---|
opaqueBackground:Null<Int>
Specifies whether the display object is opaque with a certain background color. A transparent bitmap contains alpha channel data and is drawn -transparently. An opaque bitmap has no alpha channel(and renders faster +transparently. An opaque bitmap has no alpha channel (and renders faster than a transparent bitmap). If the bitmap is opaque, you specify its own background color to use.
-If set to a number value, the surface is opaque(not transparent) with +
If set to a number value, the surface is opaque (not transparent) with
the RGB background color that the number specifies. If set to
null
(the default value), the display object has a
transparent background.
The opaque background region is not matched when calling the
hitTestPoint()
method with the shapeFlag
parameter set to true
.
The opaque background region does not respond to mouse events.
read onlyparent:DisplayObjectContainer
Indicates the DisplayObjectContainer object that contains this display +
The opaque background region does not respond to mouse events.
See also:
read onlyparent:DisplayObjectContainer
Indicates the DisplayObjectContainer object that contains this display
object. Use the parent
property to specify a relative path to
display objects that are above the current display object in the display
list hierarchy.
this.parent.parent.alpha = 20;
Throws:
SecurityError | The parent display object belongs to a security
sandbox to which you do not have access. You can
avoid this situation by having the parent movie call
-the |
---|
read onlyroot:DisplayObject
For a display object in a loaded SWF file, the root
property
+the Security.allowDomain()
method.
See also:
read onlyroot:DisplayObject
For a display object in a loaded SWF file, the root
property
is the top-most display object in the portion of the display list's tree
structure represented by that SWF file. For a Bitmap object representing a
loaded image file, the root
property is the Bitmap object
@@ -325,7 +325,7 @@
is a child of the top-most display object in a loaded SWF file.
For example, if you create a new Sprite object by calling the
Sprite()
constructor method, its root
property
-is null
until you add it to the display list(or to a display
+is null
until you add it to the display list (or to a display
object container that is off the display list but that is a child of the
top-most display object in a SWF file).
For a loaded SWF file, even though the Loader object used to load the
@@ -333,12 +333,12 @@
SWF file has its root
property set to itself. The Loader
object does not have its root
property set until it is added
as a child of a display object for which the root
property is
-set.
@:keeprotation:Float
Indicates the rotation of the DisplayObject instance, in degrees, from its +set.
See also:
@:keeprotation:Float
Indicates the rotation of the DisplayObject instance, in degrees, from its
original orientation. Values from 0 to 180 represent clockwise rotation;
values from 0 to -180 represent counterclockwise rotation. Values outside
this range are added to or subtracted from 360 to obtain a value within
the range. For example, the statement my_video.rotation = 450
-is the same as my_video.rotation = 90
.
scale9Grid:Rectangle
The current scaling grid that is in effect. If set to null
,
+is the same as my_video.rotation = 90
.
See also:
scale9Grid:Rectangle
The current scaling grid that is in effect. If set to null
,
the entire display object is scaled normally when any scale transformation
is applied.
When you define the scale9Grid
property, the display
@@ -366,11 +366,11 @@
the registration point. The default registration point is (0,0). 1.0
equals 100% scale.
Scaling the local coordinate system changes the x
and
-y
property values, which are defined in whole pixels.
@:keepscaleY:Float
Indicates the vertical scale (percentage) of an object as applied from the
+y
property values, which are defined in whole pixels.
See also:
@:keepscaleY:Float
Indicates the vertical scale (percentage) of an object as applied from the registration point of the object. The default registration point is (0,0). 1.0 is 100% scale.
Scaling the local coordinate system changes the x
and
-y
property values, which are defined in whole pixels.
scrollRect:Rectangle
The scroll rectangle bounds of the display object. The display object is
+y
property values, which are defined in whole pixels.
See also:
scrollRect:Rectangle
The scroll rectangle bounds of the display object. The display object is
cropped to the size defined by the rectangle, and it scrolls within the
rectangle when you change the x
and y
properties
of the scrollRect
object.
y
property of the
scrollRect
Rectangle object. If the display object is rotated
90° and you scroll it left and right, the display object actually scrolls
-up and down.@:betashader:Shader
BETA**
Applies a custom Shader object to use when rendering this display object (or its children) when using
hardware rendering. This occurs as a single-pass render on this object only, if visible. In order to
apply a post-process effect to multiple display objects at once, enable cacheAsBitmap
or use the
filters
property with a ShaderFilter
read onlystage:Stage
The Stage of the display object. A Flash runtime application has only one
Stage object. For example, you can create and load multiple display
objects into the display list, and the stage
property of each
-display object refers to the same Stage object(even if the display object
+display object refers to the same Stage object (even if the display object
belongs to a loaded SWF file).
If a display object is not added to the display list, its
-stage
property is set to null
.
@:keeptransform:Transform
An object with properties pertaining to a display object's matrix, color
+stage
property is set to null
.
See also:
@:keeptransform:Transform
An object with properties pertaining to a display object's matrix, color
transform, and pixel bounds. The specific properties - matrix,
colorTransform, and three read-only properties
(concatenatedMatrix
, concatenatedColorTransform
,
@@ -434,21 +434,21 @@
is adjusted accordingly, as shown in the following code:
Except for TextField and Video objects, a display object with no
content(such as an empty sprite) has a width of 0, even if you try to set
-width
to a different value.
@:keepx:Float
Indicates the x coordinate of the DisplayObject instance relative
+width
to a different value.
See also:
@:keepx:Float
Indicates the x coordinate of the DisplayObject instance relative to the local coordinates of the parent DisplayObjectContainer. If the object is inside a DisplayObjectContainer that has transformations, it is in the local coordinate system of the enclosing DisplayObjectContainer. Thus, for a DisplayObjectContainer rotated 90° counterclockwise, the DisplayObjectContainer's children inherit a coordinate system that is rotated 90° counterclockwise. The object's coordinates refer to the -registration point position.
@:keepy:Float
Indicates the y coordinate of the DisplayObject instance relative +registration point position.
See also:
@:keepy:Float
Indicates the y coordinate of the DisplayObject instance relative to the local coordinates of the parent DisplayObjectContainer. If the object is inside a DisplayObjectContainer that has transformations, it is in the local coordinate system of the enclosing DisplayObjectContainer. Thus, for a DisplayObjectContainer rotated 90° counterclockwise, the DisplayObjectContainer's children inherit a coordinate system that is rotated 90° counterclockwise. The object's coordinates refer to the -registration point position.
getBounds(targetCoordinateSpace:DisplayObject):Rectangle
Returns a rectangle that defines the area of the display object relative +registration point position.
See also:
getBounds(targetCoordinateSpace:DisplayObject):Rectangle
Returns a rectangle that defines the area of the display object relative
to the coordinate system of the targetCoordinateSpace
object.
Consider the following code, which shows how the rectangle returned can
vary depending on the targetCoordinateSpace
parameter that
@@ -475,8 +475,8 @@
coordinates, respectively.
Parameters:
targetCoordinateSpace | The display object that defines the coordinate system to use. |
---|
Returns:
The rectangle that defines the area of the display object relative
to the targetCoordinateSpace
object's coordinate
-system.
globalToLocal(pos:Point):Point
Converts the point
object from the Stage(global) coordinates
-to the display object's(local) coordinates.
globalToLocal(pos:Point):Point
Converts the point
object from the Stage (global) coordinates
+to the display object's (local) coordinates.
To use this method, first create an instance of the Point class. The
x and y values that you assign represent global coordinates
because they relate to the origin(0,0) of the main display area. Then
@@ -491,17 +491,17 @@
point specified by the x
and y
parameters. The
x
and y
parameters specify a point in the
coordinate space of the Stage, not the display object container that
-contains the display object(unless that display object container is the
+contains the display object (unless that display object container is the
Stage).
Parameters:
x | The x coordinate to test against this object. |
---|---|
y | The y coordinate to test against this object. |
shapeFlag | Whether to check against the actual pixels of the object
( |
Returns:
true
if the display object overlaps or intersects
with the specified point; false
otherwise.
invalidate():Void
Calling the invalidate()
method signals to have the current object
-redrawn the next time the object is eligible to be rendered.
localToGlobal(point:Point):Point
Converts the point
object from the display object's(local)
-coordinates to the Stage(global) coordinates.
localToGlobal(point:Point):Point
Converts the point
object from the display object's (local)
+coordinates to the Stage (global) coordinates.
This method allows you to convert any given x and y coordinates from values that are relative to the origin(0,0) of a -specific display object(local coordinates) to values that are relative to -the origin of the Stage(global coordinates).
+specific display object (local coordinates) to values that are relative to +the origin of the Stage (global coordinates).To use this method, first create an instance of the Point class. The x and y values that you assign represent local coordinates because they relate to the origin of the display object.
diff --git a/openfl/display/BitmapData.html b/openfl/display/BitmapData.html index bc3b3fe..cfe763b 100644 --- a/openfl/display/BitmapData.html +++ b/openfl/display/BitmapData.html @@ -1,7 +1,7 @@ -Available on all platforms
The BitmapData class lets you work with the data (pixels) of a Bitmap +
Available on all platforms
The BitmapData class lets you work with the data (pixels) of a Bitmap object. You can use the methods of the BitmapData class to create arbitrarily sized transparent or opaque bitmap images and manipulate them in various ways at runtime. You can also access the BitmapData for a bitmap @@ -95,13 +95,13 @@ is 8,191 pixels in width or height, and the total number of pixels cannot exceed 16,777,215 pixels. (So, if a BitmapData object is 8,191 pixels wide, it can only be 2,048 pixels high.) In Flash Player 9 and earlier, the limitation -is 2,880 pixels in height and 2,880 in width.
staticfromBase64(base64:String, type:String):BitmapData
Available on Android, Linux, Neko, Windows, iOS, macOS
Creates a new BitmapData instance from Base64-encoded data +is 2,880 pixels in height and 2,880 in width.
See also:
staticfromBase64(base64:String, type:String):BitmapData
Available on Android, HashLink, Linux, Neko, Windows, iOS, macOS
Creates a new BitmapData instance from Base64-encoded data
synchronously. This means that the BitmapData will be returned
immediately (if supported). The bytes must be of a supported bitmap file
format, such as PNG or JPG. To use raw ARGB pixel data, call
setPixels
or setVector
instead.
HTML5 and Flash do not support creating BitmapData synchronously, so these targets
-always return null
. Other targets will return null
if decoding was unsuccessful.
Parameters:
base64 | Base64-encoded data |
---|---|
type | The MIME-type for the encoded data ("image/jpeg", etc) |
Returns:
A new BitmapData if successful, or null
if unsuccessful
@:value({ rawAlpha : null })staticfromBytes(bytes:ByteArray, ?rawAlpha:ByteArray):BitmapData
Available on Android, Linux, Neko, Windows, iOS, macOS
Creates a new BitmapData from bytes (a haxe.io.Bytes
or
+always return null
. Other targets will return null
if decoding was unsuccessful.
Parameters:
base64 | Base64-encoded data |
---|---|
type | The MIME-type for the encoded data ("image/jpeg", etc) |
Returns:
A new BitmapData if successful, or null
if unsuccessful
@:value({ rawAlpha : null })staticfromBytes(bytes:ByteArray, ?rawAlpha:ByteArray):BitmapData
Available on Android, HashLink, Linux, Neko, Windows, iOS, macOS
Creates a new BitmapData from bytes (a haxe.io.Bytes
or
openfl.utils.ByteArray
) synchronously. This means that the BitmapData
will be returned immediately (if supported). The bytes must be of a
supported bitmap file format, such as PNG or JPG. To use raw ARGB pixel
@@ -111,7 +111,7 @@
The optional rawAlpha
parameter makes it easier to process images that have alpha
data stored separately.
Parameters:
bytes | A haxe.io.Bytes or openfl.utils.ByteArray instance |
---|---|
rawAlpha | An optional byte array with alpha data |
Returns:
A new BitmapData if successful, or null
if unsuccessful
@:value({ transparent : true })staticfromCanvas(canvas:CanvasElement, transparent:Bool = true):BitmapData
Available on HTML5
Creates a new BitmapData from an HTML5 canvas element immediately.
All targets except from HTML5 targets will return null
.
Parameters:
canvas | An HTML5 canvas element |
---|---|
transparent | Whether the new BitmapData object should be considered -transparent |
Returns:
A new BitmapData if successful, or null
if unsuccessful
staticfromFile(path:String):BitmapData
Available on Android, Linux, Neko, Windows, iOS, macOS
Creates a new BitmapData from a file path synchronously. This means that the +transparent
Returns:
A new BitmapData if successful, or null
if unsuccessful
staticfromFile(path:String):BitmapData
Available on Android, HashLink, Linux, Neko, Windows, iOS, macOS
Creates a new BitmapData from a file path synchronously. This means that the BitmapData will be returned immediately (if supported).
HTML5 and Flash do not support creating BitmapData synchronously, so these targets
always return null
.
Parameters:
width | The width of the bitmap image in pixels. |
---|---|
height | The height of the bitmap image in pixels. |
transparent | Specifies whether the bitmap image supports per-pixel transparency. The default value is |
fillColor | A 32-bit ARGB color value that you use to fill the bitmap image area. The default value is 0xFFFFFFFF(solid white). |
@SuppressWarnings("checkstyle:Dynamic")read onlyimage:Image
The Lime image that holds the pixels for the current image.
+channel information, including an alpha transparency channel.Parameters:
width | The width of the bitmap image in pixels. |
---|---|
height | The height of the bitmap image in pixels. |
transparent | Specifies whether the bitmap image supports per-pixel transparency. The default value is |
fillColor | A 32-bit ARGB color value that you use to fill the bitmap image area. The default value is 0xFFFFFFFF (solid white). |
@SuppressWarnings("checkstyle:Dynamic")read onlyimage:Image
The Lime image that holds the pixels for the current image.
In Flash Player, this property is always null
.
@:betaread onlyreadable:Bool
Defines whether the bitmap image is readable. Hardware-only bitmap images
do not support getPixels
, setPixels
and other
BitmapData methods, nor may they be used with
@@ -169,7 +169,7 @@
pixels outside the sourceRect
parameter to generate the destination rectangle.
If the BitmapData object and the object specified as the sourceBitmapData
parameter are the same object, the application uses a temporary copy of the object to
-perform the filter. For best performance, avoid this situation.
Parameters:
sourceBitmapData | The input bitmap image to use. The source image can be a different BitmapData object or it can refer to the current BitmapData instance. |
---|---|
sourceRect | A rectangle that defines the area of the source image to use as input. |
destPoint | The point within the destination image(the current BitmapData instance) that corresponds to the upper-left corner of the source rectangle. |
filter | The filter object that you use to perform the filtering operation. |
clone():BitmapData
Returns a new BitmapData object that is a clone of the original instance with an exact copy of the contained bitmap.
Returns:
A new BitmapData object that is identical to the original.
colorTransform(rect:Rectangle, colorTransform:ColorTransform):Void
Adjusts the color values in a specified area of a bitmap image by using a ColorTransform
+perform the filter. For best performance, avoid this situation.
Parameters:
sourceBitmapData | The input bitmap image to use. The source image can be a different BitmapData object or it can refer to the current BitmapData instance. |
---|---|
sourceRect | A rectangle that defines the area of the source image to use as input. |
destPoint | The point within the destination image (the current BitmapData instance) that corresponds to the upper-left corner of the source rectangle. |
filter | The filter object that you use to perform the filtering operation. |
clone():BitmapData
Returns a new BitmapData object that is a clone of the original instance with an exact copy of the contained bitmap.
Returns:
A new BitmapData object that is identical to the original.
colorTransform(rect:Rectangle, colorTransform:ColorTransform):Void
Adjusts the color values in a specified area of a bitmap image by using a ColorTransform
object. If the rectangle matches the boundaries of the bitmap image, this method transforms the color
values of the entire image.
Parameters:
rect | A Rectangle object that defines the area of the image in which the ColorTransform object is applied. |
---|---|
colorTransform | A ColorTransform object that describes the color transformation values to apply. |
@SuppressWarnings("checkstyle:Dynamic")compare(otherBitmapData:BitmapData):Dynamic
Compares two BitmapData objects. If the two BitmapData objects have the same dimensions (width and height), the method returns a new BitmapData object, in which each pixel is the "difference" between the pixels in the two source objects:
Parameters:
otherBitmapData | The BitmapData object to compare with the source BitmapData object. |
---|
Returns:
If the two BitmapData objects have the same dimensions (width and height), the method returns a new BitmapData object that has the difference between the two objects (see the main discussion).If the BitmapData objects are equivalent, the method returns the number 0. If no argument is passed or if the argument is not a BitmapData object, the method returns -1. If either BitmapData object has been disposed of, the method returns -2. If the widths of the BitmapData objects are not equal, the method returns the number -3. If the heights of the BitmapData objects are not equal, the method returns the number -4.
copyChannel(sourceBitmapData:BitmapData, sourceRect:Rectangle, destPoint:Point, sourceChannel:BitmapDataChannel, destChannel:BitmapDataChannel):Void
Transfers data from one channel of another BitmapData object or the current BitmapData object into a channel of the current BitmapData object. @@ -199,7 +199,7 @@
BitmapDataChannel.BLUE
,
BitmapDataChannel.GREEN
,
-BitmapDataChannel.ALPHA
).
Throws:
TypeError | The sourceBitmapData, sourceRect or destPoint are null. |
---|
@:value({ mergeAlpha : false, alphaPoint : null, alphaBitmapData : null })copyPixels(sourceBitmapData:BitmapData, sourceRect:Rectangle, destPoint:Point, ?alphaBitmapData:BitmapData, ?alphaPoint:Point, mergeAlpha:Bool = false):Void
Provides a fast routine to perform pixel manipulation between images with
+BitmapDataChannel.ALPHA
).
Throws:
TypeError | The sourceBitmapData, sourceRect or destPoint are null. |
---|
See also:
@:value({ mergeAlpha : false, alphaPoint : null, alphaBitmapData : null })copyPixels(sourceBitmapData:BitmapData, sourceRect:Rectangle, destPoint:Point, ?alphaBitmapData:BitmapData, ?alphaPoint:Point, mergeAlpha:Bool = false):Void
Provides a fast routine to perform pixel manipulation between images with no stretching, rotation, or color effects. This method copies a rectangular area of a source image to a rectangular area of the same size at the destination point of the destination BitmapData object.
@@ -225,7 +225,7 @@ that corresponds to the upper-left corner of thesourceRect
parameter.mergeAlpha
To use the alpha channel, set the value to
true
. To copy pixels with no alpha
-channel, set the value to false
.
Throws:
TypeError | The sourceBitmapData, sourceRect, destPoint are null. |
---|
dispose():Void
Frees memory that is used to store the BitmapData object.
+channel, set the value tofalse
.Throws:
TypeError | The sourceBitmapData, sourceRect, destPoint are null. |
---|
See also:
dispose():Void
Frees memory that is used to store the BitmapData object.
When the dispose()
method is called on an image, the width
and height of the image are set to 0. All subsequent calls to methods or
properties of this BitmapData instance fail, and an exception is thrown.
BitmapData.disposeImage()
will immediately change the value of
-the readable
property to false
.
@:value({ smoothing : false, clipRect : null, blendMode : null, colorTransform : null, matrix : null })draw(source:IBitmapDrawable, ?matrix:Matrix, ?colorTransform:ColorTransform, ?blendMode:BlendMode, ?clipRect:Rectangle, smoothing:Bool = false):Void
Draws the source
display object onto the bitmap image, using
+the readable
property to false
.
@:value({ smoothing : false, clipRect : null, blendMode : null, colorTransform : null, matrix : null })draw(source:IBitmapDrawable, ?matrix:Matrix, ?colorTransform:ColorTransform, ?blendMode:BlendMode, ?clipRect:Rectangle, smoothing:Bool = false):Void
Draws the source
display object onto the bitmap image, using
the OpenFL software renderer. You can specify matrix
,
colorTransform
, blendMode
, and a destination
clipRect
parameter to control how the rendering performs.
@@ -253,7 +253,7 @@
The source display object does not use any of its applied
transformations for this call. It is treated as it exists in the library
or file, with no matrix transform, no color transform, and no blend mode.
-To draw a display object(such as a movie clip) by using its own transform
+To draw a display object (such as a movie clip) by using its own transform
properties, you can copy its transform
property object to the
transform
property of the Bitmap object that uses the
BitmapData object.
Parameters:
source | The display object or BitmapData object to draw to
@@ -295,14 +295,14 @@
|
---|
Throws:
ArgumentError | The |
---|---|
ArgumentError | The source is null or not a valid IBitmapDrawable -object. |
SecurityError | The |
SecurityError | The |
@:value({ quality : null, smoothing : false, clipRect : null, blendMode : null, colorTransform : null, matrix : null })drawWithQuality(source:IBitmapDrawable, ?matrix:Matrix, ?colorTransform:ColorTransform, ?blendMode:BlendMode, ?clipRect:Rectangle, smoothing:Bool = false, ?quality:StageQuality):Void
Draws the source
display object onto the bitmap image, using the Flash runtime
+application security sandbox.
See also:
@:value({ quality : null, smoothing : false, clipRect : null, blendMode : null, colorTransform : null, matrix : null })drawWithQuality(source:IBitmapDrawable, ?matrix:Matrix, ?colorTransform:ColorTransform, ?blendMode:BlendMode, ?clipRect:Rectangle, smoothing:Bool = false, ?quality:StageQuality):Void
Draws the source
display object onto the bitmap image, using the Flash runtime
vector renderer. You can specify matrix
, colorTransform
, blendMode
, and a
destination clipRect
parameter to control how the rendering performs.
Optionally, you can specify whether the bitmap should be smoothed when scaled
@@ -369,7 +369,7 @@
object) all of its child objects do not come from the same domain as the caller,
or are not in a content that is accessible to the caller by having called the
Security.allowDomain()
method. This restriction does not apply to AIR content
-in the application security sandbox.
ArgumentError
The source is null
or not a valid IBitmapDrawable object.
@:value({ byteArray : null })encode(rect:Rectangle, compressor:Object, ?byteArray:ByteArray):ByteArray
Compresses this BitmapData object using the selected compressor algorithm and +in the application security sandbox.
ArgumentError
The source is null
or not a valid IBitmapDrawable object.
See also:
@:value({ byteArray : null })encode(rect:Rectangle, compressor:Object, ?byteArray:ByteArray):ByteArray
Compresses this BitmapData object using the selected compressor algorithm and
returns a new ByteArray object. Optionally, writes the resulting data to the
specified ByteArray. The compressor
argument specifies the encoding algorithm,
and can be PNGEncoderOptions, JPEGEncoderOptions, or JPEGXREncoderOptions.
Parameters:
rect | The area of the BitmapData object to compress. |
---|---|
compressor | The compressor type to use. Valid values are: flash.display.PNGEncoderOptions, flash.display.JPEGEncoderOptions, and -flash.display.JPEGXREncoderOptions. |
byteArray | The output ByteArray to hold the encoded image. |
Returns:
A ByteArray containing the encoded image.
fillRect(rect:Rectangle, color:Int):Void
Fills a rectangular area of pixels with a specified ARGB color.
Parameters:
rect | The rectangular area to fill. |
---|---|
color | The ARGB color value that fills the area. ARGB colors are +flash.display.JPEGXREncoderOptions. |
byteArray | The output ByteArray to hold the encoded image. |
Returns:
A ByteArray containing the encoded image.
See also:
fillRect(rect:Rectangle, color:Int):Void
Fills a rectangular area of pixels with a specified ARGB color.
Parameters:
rect | The rectangular area to fill. |
---|---|
color | The ARGB color value that fills the area. ARGB colors are often specified in hexadecimal format; for example, 0xFF336699. |
Throws:
TypeError | The rect is null. |
---|
floodFill(x:Int, y:Int, color:Int):Void
Performs a flood fill operation on an image starting at an(x, y) coordinate and filling with a certain color. The @@ -403,9 +403,9 @@ as input.
filter
A filter object that you use to calculate the destination rectangle.
Returns:
A destination rectangle computed by using an image, the
sourceRect
parameter, and a filter.
Throws:
TypeError | The sourceRect or filter are null. |
---|
@:value({ findColor : true })getColorBoundsRect(mask:Int, color:Int, findColor:Bool = true):Rectangle
Determines a rectangular region that either fully encloses all pixels of a
-specified color within the bitmap image(if the findColor
+specified color within the bitmap image (if the findColor
parameter is set to true
) or fully encloses all pixels that
-do not include the specified color(if the findColor
+do not include the specified color (if the findColor
parameter is set to false
).
For example, if you have a source image and you want to determine the rectangle of the image that contains a nonzero alpha channel, pass @@ -442,7 +442,7 @@ set operation, the pixel value is premultiplied before the raw image pixel is set.
Parameters:
x | The x position of the pixel. |
---|---|
y | The y position of the pixel. |
Returns:
A number that represents an RGB pixel value. If the(x, y) coordinates are outside the bounds of the image, the -method returns 0.
getPixel32(x:Int, y:Int):Int
Returns an ARGB color value that contains alpha channel data and RGB data. +method returns 0.
See also:
getPixel32(x:Int, y:Int):Int
Returns an ARGB color value that contains alpha channel data and RGB data.
This method is similar to the getPixel()
method, which
returns an RGB color without alpha channel data.
All pixels in a BitmapData object are stored as premultiplied color @@ -456,10 +456,10 @@ set operation, the pixel value is premultiplied before the raw image pixel is set.
Parameters:
x | The x position of the pixel. |
---|---|
y | The y position of the pixel. |
Returns:
A number representing an ARGB pixel value. If the(x, y) coordinates are outside the bounds of the image, 0 is -returned.
getPixels(rect:Rectangle):ByteArray
Generates a byte array from a rectangular region of pixel data. Writes an +unsigned integer (a 32-bit unmultiplied pixel value) for each pixel into the byte array.
Parameters:
rect | A rectangular area in the current BitmapData object. |
---|
Returns:
A ByteArray representing the pixels in the given Rectangle.
Throws:
TypeError | The rect is null. |
---|
getVector(rect:Rectangle):Vector<UInt>
Generates a vector array from a rectangular region of pixel data. Returns -a Vector object of unsigned integers(a 32-bit unmultiplied pixel value) +a Vector object of unsigned integers (a 32-bit unmultiplied pixel value) for the specified rectangle.
Parameters:
rect | A rectangular area in the current BitmapData object. |
---|
Returns:
A Vector representing the given Rectangle.
Throws:
TypeError | The rect is null. |
---|
@:value({ hRect : null })histogram(?hRect:Rectangle):Array<Array<Int>>
Computes a 256-value binary number histogram of a BitmapData object. This method
returns a Vector object containing four Vector
low
The lowest value to generate for each channel(0 to -255).
high
The highest value to generate for each channel(0 to +random seed.
low
The lowest value to generate for each channel (0 to +255).
high
The highest value to generate for each channel (0 to 255).
channelOptions
A number that can be a combination of any of the four color channel values
(`BitmapDataChannel.RED`,
@@ -528,7 +528,7 @@
a grayscale image is created by setting all of the
color channels to the same value. The alpha channel
selection is not affected by setting this parameter
-to true
.
@:value({ alphaArray : null, blueArray : null, greenArray : null, redArray : null })paletteMap(sourceBitmapData:BitmapData, sourceRect:Rectangle, destPoint:Point, ?redArray:Array<Int>, ?greenArray:Array<Int>, ?blueArray:Array<Int>, ?alphaArray:Array<Int>):Void
Remaps the color channel values in an image that has up to four arrays of
+to true
.
See also:
@:value({ alphaArray : null, blueArray : null, greenArray : null, redArray : null })paletteMap(sourceBitmapData:BitmapData, sourceRect:Rectangle, destPoint:Point, ?redArray:Array<Int>, ?greenArray:Array<Int>, ?blueArray:Array<Int>, ?alphaArray:Array<Int>):Void
Remaps the color channel values in an image that has up to four arrays of color palette data, one for each channel.
Flash runtimes use the following steps to generate the resulting image:
destPoint
The point within the destination image (the current BitmapData object) that corresponds to the upper-left corner of the source rectangle.
redArray
If redArray
is not null
, red = redArray[source red value] else red = source rect value
.
greenArray
If greenArray
is not null
, green = greenArray[source green value] else green = source green value
.
blueArray
If blueArray
is not null,
blue = blueArray[source blue value] else blue = source blue value`.
alphaArray
If alphaArray
is not null,
alpha = alphaArray[source alpha value] else alpha = source alpha value`.
Throws:
TypeError | The |
---|
@:value({ offsets : null, grayScale : false, channelOptions : 7 })perlinNoise(baseX:Float, baseY:Float, numOctaves:UInt, randomSeed:Int, stitch:Bool, fractalNoise:Bool, channelOptions:UInt = 7, grayScale:Bool = false, ?offsets:Array<Point>):Void
Generates a Perlin noise image.
The Perlin noise generation algorithm interpolates and combines
-individual random noise functions(called octaves) into a single function
+individual random noise functions (called octaves) into a single function
that generates more natural-seeming random noise. Like musical octaves,
each octave function is twice the frequency of the one before it. Perlin
noise has been described as a "fractal sum of noise" because it combines
@@ -600,8 +600,8 @@
a grayscale image is created by setting each of the
red, green, and blue color channels to identical
values. The alpha channel value is not affected if
-this value is set to true
.
scroll(x:Int, y:Int):Void
Scrolls an image by a certain(x, y) pixel amount. Edge -regions outside the scrolling area are left unchanged.
Parameters:
x | The amount by which to scroll horizontally. |
---|---|
y | The amount by which to scroll vertically. |
setPixel(x:Int, y:Int, color:Int):Void
Sets a single pixel of a BitmapData object. The current alpha channel
+this value is set to true
.
See also:
scroll(x:Int, y:Int):Void
Scrolls an image by a certain(x, y) pixel amount. Edge +regions outside the scrolling area are left unchanged.
Parameters:
x | The amount by which to scroll horizontally. |
---|---|
y | The amount by which to scroll vertically. |
See also:
setPixel(x:Int, y:Int, color:Int):Void
Sets a single pixel of a BitmapData object. The current alpha channel value of the image pixel is preserved during this operation. The value of the RGB color parameter is treated as an unmultiplied color value.
Note: To increase performance, when you use the
@@ -610,7 +610,7 @@
setPixel()
or setPixel32()
method, and then call
the unlock()
method when you have made all pixel changes.
This process prevents objects that reference this BitmapData instance from
-updating until you finish making the pixel changes.
Parameters:
x | The x position of the pixel whose value changes. |
---|---|
y | The y position of the pixel whose value changes. |
color | The resulting RGB color for the pixel. |
setPixel32(x:Int, y:Int, color:Int):Void
Sets the color and alpha transparency values of a single pixel of a +updating until you finish making the pixel changes.
Parameters:
x | The x position of the pixel whose value changes. |
---|---|
y | The y position of the pixel whose value changes. |
color | The resulting RGB color for the pixel. |
See also:
setPixel32(x:Int, y:Int, color:Int):Void
Sets the color and alpha transparency values of a single pixel of a
BitmapData object. This method is similar to the setPixel()
method; the main difference is that the setPixel32()
method
takes an ARGB color value that contains alpha channel information.
Parameters:
x | The x position of the pixel whose value changes. |
---|---|
y | The y position of the pixel whose value changes. |
color | The resulting ARGB color for the pixel. If the bitmap is opaque(not transparent), the alpha transparency portion of -this color value is ignored. |
setPixels(rect:Rectangle, byteArray:ByteArray):Void
Converts a byte array into a rectangular region of pixel data. For each +this color value is ignored.
See also:
setPixels(rect:Rectangle, byteArray:ByteArray):Void
Converts a byte array into a rectangular region of pixel data. For each
pixel, the ByteArray.readUnsignedInt()
method is called and
the return value is written into the pixel. If the byte array ends before
the full rectangle is written, the function returns. The data in the byte
diff --git a/openfl/display/BitmapDataChannel.html b/openfl/display/BitmapDataChannel.html
index 47e7dc4..dfa8f11 100644
--- a/openfl/display/BitmapDataChannel.html
+++ b/openfl/display/BitmapDataChannel.html
@@ -1,7 +1,7 @@
-
Available on all platforms
The BitmapDataChannel class is an enumeration of constant values that +
Available on all platforms
The BitmapDataChannel class is an enumeration of constant values that indicate which channel to use: red, blue, green, or alpha transparency.
When you call some methods, you can use the bitwise OR operator
(|
) to combine BitmapDataChannel constants to indicate
@@ -63,4 +63,4 @@
parameters of the openfl.display.BitmapData.copyChannel()
method
channelOptions
parameter of the
openfl.display.BitmapData.noise()
methodopenfl.filters.DisplacementMapFilter.componentX
and
-openfl.filters.DisplacementMapFilter.componentY
propertiesopenfl.filters.DisplacementMapFilter.componentY
propertiesSee also:
A class that provides constant values for visual blend mode effects. These +
A class that provides constant values for visual blend mode effects. These constants are used in the following:
blendMode
property of the
openfl.display.DisplayObject class.blendMode
parameter of the draw()
-method of the openfl.display.BitmapData class@:value(cast 0)@:impl@:enuminlineread onlyADD:BlendMode = 0
Adds the values of the constituent colors of the display object to the +method of the openfl.display.BitmapData class
See also:
@:value(cast 0)@:impl@:enuminlineread onlyADD:BlendMode = 0
Adds the values of the constituent colors of the display object to the colors of its background, applying a ceiling of 0xFF. This setting is commonly used for animating a lightening dissolve between two objects.
For example, if the display object has a pixel with an RGB value of 0xAAA633, and the background pixel has an RGB value of 0xDD2200, the -resulting RGB value for the displayed pixel is 0xFFC833(because 0xAA + +resulting RGB value for the displayed pixel is 0xFFC833 (because 0xAA + 0xDD > 0xFF, 0xA6 + 0x22 = 0xC8, and 0x33 + 0x00 = 0x33).
@:value(cast 1)@:impl@:enuminlineread onlyALPHA:BlendMode = 1
Applies the alpha value of each pixel of the display object to the
background. This requires the blendMode
property of the
parent display object be set to
openfl.display.BlendMode.LAYER
.
Not supported under GPU rendering.
@:value(cast 2)@:impl@:enuminlineread onlyDARKEN:BlendMode = 2
Selects the darker of the constituent colors of the display object and the -colors of the background(the colors with the smaller values). This +colors of the background (the colors with the smaller values). This setting is commonly used for superimposing type.
For example, if the display object has a pixel with an RGB value of 0xFFCC33, and the background pixel has an RGB value of 0xDDF800, the -resulting RGB value for the displayed pixel is 0xDDCC00(because 0xFF > +resulting RGB value for the displayed pixel is 0xDDCC00 (because 0xFF > 0xDD, 0xCC < 0xF8, and 0x33 > 0x00 = 33).
Not supported under GPU rendering.
@:value(cast 3)@:impl@:enuminlineread onlyDIFFERENCE:BlendMode = 3
Compares the constituent colors of the display object with the colors of its background, and subtracts the darker of the values of the two @@ -79,7 +79,7 @@ for more vibrant colors.
For example, if the display object has a pixel with an RGB value of 0xFFCC33, and the background pixel has an RGB value of 0xDDF800, the -resulting RGB value for the displayed pixel is 0x222C33(because 0xFF - +resulting RGB value for the displayed pixel is 0x222C33 (because 0xFF - 0xDD = 0x22, 0xF8 - 0xCC = 0x2C, and 0x33 - 0x00 = 0x33).
@:value(cast 4)@:impl@:enuminlineread onlyERASE:BlendMode = 4
Erases the background based on the alpha value of the display object. This
process requires that the blendMode
property of the parent
display object be set to openfl.display.BlendMode.LAYER
.
blendMode
setting other than "normal"
.
Not supported under GPU rendering.
@:value(cast 8)@:impl@:enuminlineread onlyLIGHTEN:BlendMode = 8
Selects the lighter of the constituent colors of the display object and -the colors of the background(the colors with the larger values). This +the colors of the background (the colors with the larger values). This setting is commonly used for superimposing type.
For example, if the display object has a pixel with an RGB value of 0xFFCC33, and the background pixel has an RGB value of 0xDDF800, the -resulting RGB value for the displayed pixel is 0xFFF833(because 0xFF > +resulting RGB value for the displayed pixel is 0xFFF833 (because 0xFF > 0xDD, 0xCC < 0xF8, and 0x33 > 0x00 = 33).
Not supported under GPU rendering.
@:value(cast 9)@:impl@:enuminlineread onlyMULTIPLY:BlendMode = 9
Multiplies the values of the display object constituent colors by the constituent colors of the background color, and normalizes by dividing by 0xFF, resulting in darker colors. This setting is commonly used for shadows and depth effects.
-For example, if a constituent color(such as red) of one pixel in the +
For example, if a constituent color (such as red) of one pixel in the display object and the corresponding color of the pixel in the background both have the value 0x88, the multiplied result is 0x4840. Dividing by 0xFF yields a value of 0x48 for that constituent color, which is a darker @@ -119,7 +119,7 @@ background is darker than 50% gray, the colors are multiplied, which results in a darker color. This setting is commonly used for shading effects.
-Not supported under GPU rendering.
@:value(cast 12)@:impl@:enuminlineread onlySCREEN:BlendMode = 12
Multiplies the complement(inverse) of the display object color by the +
Not supported under GPU rendering.
@:value(cast 12)@:impl@:enuminlineread onlySCREEN:BlendMode = 12
Multiplies the complement (inverse) of the display object color by the complement of the background color, resulting in a bleaching effect. This setting is commonly used for highlights or to remove black areas of the display object.
@:value(cast 13)@:impl@:enuminlineread onlySHADER:BlendMode = 13
Uses a shader to define the blend between objects.
@@ -138,5 +138,5 @@ commonly used for animating a darkening dissolve between two objects.For example, if the display object has a pixel with an RGB value of 0xAA2233, and the background pixel has an RGB value of 0xDDA600, the -resulting RGB value for the displayed pixel is 0x338400(because 0xDD - +resulting RGB value for the displayed pixel is 0x338400 (because 0xDD - 0xAA = 0x33, 0xA6 - 0x22 = 0x84, and 0x00 - 0x33 < 0x00).
Available on all platforms
BETA**
+Available on all platforms
BETA**
The CairoRenderer API exposes support for native Cairo render instructions within the
RenderEvent.RENDER_CAIRO
event
@:value({ cairo : null })@SuppressWarnings("checkstyle:Dynamic")applyMatrix(transform:Matrix, ?cairo:Cairo):Void
Set the matrix value for the current render context, or (optionally) another Cairo object
@:value({ useWeakReference : false, priority : 0, useCapture : false })addEventListener<T>(type:EventType<T>, listener:T ‑> Void, useCapture:Bool = false, priority:Int = 0, useWeakReference:Bool = false):Void
Registers an event listener object with an EventDispatcher object so that @@ -128,7 +128,7 @@ for a listener that is a nested inner function, the function will be garbage-collected and no longer persistent. If you create references to the -inner function(save it in another variable) then +inner function (save it in another variable) then it is not garbage-collected and stays persistent.
Weak references are supported on some OpenFL diff --git a/openfl/display/CanvasRenderer.html b/openfl/display/CanvasRenderer.html index fc0bc53..5190101 100644 --- a/openfl/display/CanvasRenderer.html +++ b/openfl/display/CanvasRenderer.html @@ -1,7 +1,7 @@ -
Available on all platforms
BETA**
+Available on all platforms
BETA**
The CanvasRenderer API exposes support for HTML5 canvas render instructions within the
RenderEvent.RENDER_CANVAS
event
@SuppressWarnings("checkstyle:Dynamic")context:Canvas2DRenderContext
The current HTML5 canvas render context
@SuppressWarnings("checkstyle:Dynamic")applySmoothing(context:Canvas2DRenderContext, value:Bool):Void
Set whether smoothing should be enabled on a canvas context
@:value({ context : null })@SuppressWarnings("checkstyle:Dynamic")setTransform(transform:Matrix, ?context:Canvas2DRenderContext):Void
Set the matrix value for the current render context, or (optionally) another canvas context
@:value({ useWeakReference : false, priority : 0, useCapture : false })addEventListener<T>(type:EventType<T>, listener:T ‑> Void, useCapture:Bool = false, priority:Int = 0, useWeakReference:Bool = false):Void
Registers an event listener object with an EventDispatcher object so that @@ -128,7 +128,7 @@ for a listener that is a nested inner function, the function will be garbage-collected and no longer persistent. If you create references to the -inner function(save it in another variable) then +inner function (save it in another variable) then it is not garbage-collected and stays persistent.
Weak references are supported on some OpenFL diff --git a/openfl/display/CapsStyle.html b/openfl/display/CapsStyle.html index b244e0a..8fc1792 100644 --- a/openfl/display/CapsStyle.html +++ b/openfl/display/CapsStyle.html @@ -1,7 +1,7 @@ -
The CapsStyle class is an enumeration of constant values that specify the +
The CapsStyle class is an enumeration of constant values that specify the
caps style to use in drawing lines. The constants are provided for use as
values in the caps
parameter of the
openfl.display.Graphics.lineStyle()
method. You can specify the
diff --git a/openfl/display/ChildAccess.html b/openfl/display/ChildAccess.html
index 864c72b..9c71440 100644
--- a/openfl/display/ChildAccess.html
+++ b/openfl/display/ChildAccess.html
@@ -1,7 +1,7 @@
-
Available on all platforms
The ChildAccess abstract simplifies access to nested DisplayObjects. Although +
Available on all platforms
The ChildAccess abstract simplifies access to nested DisplayObjects. Although performance may be somewhat slower than using direct references, this is especially useful when setting up a UI or performing non-intensive tasks.
For example, consider the following hierarchy:
@@ -72,4 +72,4 @@You can use array access to reach child instances as well. This is useful if the child object has the name of a DisplayObject property, or if it uses special characters:
var movieClip:ChildAccess<MovieClip> = movieClip;
-movieClip.sprite["sprite2"].x = 100;
staticantiAliasType:AntiAliasType
Accesses the antiAliasType
property (for TextField instances only).
staticread onlycurrentFrameLabel:String
Accesses the currentFrameLabel
property (for MovieClip instances only).
staticread onlycurrentLabel:String
Accesses the currentLabel
property (for MovieClip instances only).
staticread onlycurrentLabels:Array<FrameLabel>
Accesses the currentLabels
property (for MovieClip instances only).
staticdefaultTextFormat:TextFormat
Accesses the defaultTextFormat
property (for TextField instances only).
staticdoubleClickEnabled:Bool
Accesses the doubleClickEnabled
property (for InteractiveObject instances only).
staticread onlydropTarget:DisplayObject
Accesses the dropTarget
property (for Sprite instances only).
staticread onlygraphics:Graphics
Accesses the graphics
property (for Shape or Sprite instances only).
staticmouseChildren:Bool
Accesses the mouseChildren
property (for DisplayObjectContainer instances only).
staticneedsSoftKeyboard:Bool
Accesses the needsSoftKeyboard
property (for InteractiveObject instances only).
staticread onlynumChildren:Int
Accesses the numChildren
property (for DisplayObjectContainer instances only).
staticread onlyselectionBeginIndex:Int
Accesses the selectionBeginIndex
property (for TextField instances only).
staticread onlyselectionEndIndex:Int
Accesses the selectionEndIndex
property (for TextField instances only).
staticsoftKeyboardInputAreaOfInterest:Rectangle
Accesses the softKeyboardInputAreaOfInterest
property (for InteractiveObject instances only).
statictabChildren:Bool
Accesses the tabChildren
property (for DisplayObjectContainer instances only).
statictileBlendModeEnabled:Bool
Accesses the tileBlendModeEnabled
property (for Tilemap instances only).
statictileColorTransformEnabled:Bool
Accesses the tileColorTransformEnabled
property (for Tilemap instances only).
staticaddChild(this:T, child:DisplayObject):DisplayObject
Accesses the addChild
method (for DisplayObjectContainer instances only).
staticaddChildAt(this:T, child:DisplayObject, index:Int):DisplayObject
Accesses the addChildAt
method (for DisplayObjectContainer instances only).
@:value({ useWeakReference : false, priority : 0, useCapture : false })staticaddEventListener<T2>(this:T, type:EventType<T2>, listener:T2 ‑> Void, useCapture:Bool = false, priority:Int = 0, useWeakReference:Bool = false):Void
Accesses the addEventListener
method.
staticaddFrameScript(this:T, index:Int, method:() ‑> Void):Void
Accesses the addFrameScript
method (for MovieClip instances only).
staticaddTileAt(this:T, tile:Tile, index:Int):Tile
Accesses the addTileAt
method (for Tilemap instances only).
staticaddTiles(this:T, tiles:Array<Tile>):Array<Tile>
Accesses the addTiles
method (for Tilemap instances only).
staticappendText(this:T, text:String):Void
Accesses the appendText
method (for TextField instances only).
staticareInaccessibleObjectsUnderPoint(this:T, point:Point):Bool
Accesses the areInaccessibleObjectsUnderPoint
method (for DisplayObjectContainer instances only).
staticattachNetStream(this:T, netStream:NetStream):Void
Accesses the attachNetStream
method (for Video instances only).
staticattachTimeline(this:T, timeline:Timeline):Void
Accesses the attachTimeline
method (for MovieClip instances only).
staticcontains(this:T, child:Dynamic):Bool
Accesses the contains
method (for Tilemap or DisplayObjectContainer instances only).
staticgetBounds(this:T, targetCoordinateSpace:DisplayObject):Rectangle
Accesses the getBounds
method.
staticgetCharBoundaries(this:T, charIndex:Int):Rectangle
Accesses the getCharBoundaries
method (for TextField instances only).
staticgetCharIndexAtPoint(this:T, x:Float, y:Float):Int
Accesses the getCharIndexAtPoint
method (for TextField instances only).
staticgetChildAt(this:T, index:Int):DisplayObject
Accesses the getChildAt
method (for DisplayObjectContainer instances only).
staticgetChildByName(this:T, name:String):DisplayObject
Accesses the getChildByName
method (for DisplayObjectContainer instances only).
staticgetChildIndex(this:T, child:DisplayObject):Int
Accesses the getChildIndex
method (for DisplayObjectContainer instances only).
staticgetFirstCharInParagraph(this:T, charIndex:Int):Int
Accesses the getFirstCharInParagraph
method (for TextField instances only).
staticgetLineIndexAtPoint(this:T, x:Float, y:Float):Int
Accesses the getLineIndexAtPoint
method (for TextField instances only).
staticgetLineIndexOfChar(this:T, charIndex:Int):Int
Accesses the getLineIndexOfChar
method (for TextField instances only).
staticgetLineLength(this:T, lineIndex:Int):Int
Accesses the getLineLength
method (for TextField instances only).
staticgetLineMetrics(this:T, lineIndex:Int):TextLineMetrics
Accesses the getLineMetrics
method (for TextField instances only).
staticgetLineOffset(this:T, lineIndex:Int):Int
Accesses the getLineOffset
method (for TextField instances only).
staticgetLineText(this:T, lineIndex:Int):String
Accesses the getLineText
method (for TextField instances only).
staticgetObjectsUnderPoint(this:T, point:Point):Array<DisplayObject>
Accesses the getObjectsUnderPoint
method (for DisplayObjectContainer instances only).
staticgetParagraphLength(this:T, charIndex:Int):Int
Accesses the getParagraphLength
method (for TextField instances only).
@:value({ endIndex : -1, beginIndex : -1 })staticgetTextFormat(this:T, beginIndex:Int = -1, endIndex:Int = -1):TextFormat
Accesses the getTextFormat
method (for TextField instances only).
staticgetTileIndex(this:T, tile:Tile):Int
Accesses the getTileIndex
method (for Tilemap instances only).
@:value({ scene : null })staticgotoAndPlay(this:T, frame:Any, ?scene:String):Void
Accesses the gotoAndPlay
method (for MovieClip instances only).
@:value({ scene : null })staticgotoAndStop(this:T, frame:Any, ?scene:String):Void
Accesses the gotoAndStop
method (for MovieClip instances only).
@:value({ shapeFlag : false })statichitTestPoint(this:T, x:Float, y:Float, shapeFlag:Bool = false):Bool
Accesses the hitTestPoint
method.
staticremoveChild(this:T, child:DisplayObject):DisplayObject
Accesses the removeChild
method (for DisplayObjectContainer instances only).
staticremoveChildAt(this:T, index:Int):DisplayObject
Accesses the removeChildAt
method (for DisplayObjectContainer instances only).
@:value({ endIndex : 0x7FFFFFFF, beginIndex : 0 })staticremoveChildren(this:T, beginIndex:Int = 0, endIndex:Int = 0x7FFFFFFF):Void
Accesses the removeChildren
method (for DisplayObjectContainer instances only).
@:value({ useCapture : false })staticremoveEventListener<T2>(this:T, type:EventType<T2>, listener:T2 ‑> Void, useCapture:Bool = false):Void
Accesses the removeEventListener
method.
staticremoveTile(this:T, tile:Tile):Tile
Accesses the removeTile
method (for Tilemap instances only).
staticremoveTileAt(this:T, index:Int):Tile
Accesses the removeTileAt
method (for Tilemap instances only).
@:value({ endIndex : 0x7fffffff, beginIndex : 0 })staticremoveTiles(this:T, beginIndex:Int = 0, endIndex:Int = 0x7fffffff):Void
Accesses the removeTiles
method (for Tilemap instances only).
staticreplaceSelectedText(this:T, value:String):Void
Accesses the replaceSelectedText
method (for TextField instances only).
staticreplaceText(this:T, beginIndex:Int, endIndex:Int, newText:String):Void
Accesses the replaceText
method (for TextField instances only).
staticrequestSoftKeyboard(this:T):Bool
Accesses the requestSoftKeyboard
method (for InteractiveObject instances only).
staticsetChildIndex(this:T, child:DisplayObject, index:Int):Void
Accesses the setChildIndex
method (for DisplayObjectContainer instances only).
staticsetSelection(this:T, beginIndex:Int, endIndex:Int):Void
Accesses the setSelection
method (for TextField instances only).
@:value({ endIndex : -1, beginIndex : -1 })staticsetTextFormat(this:T, format:TextFormat, beginIndex:Int = -1, endIndex:Int = -1):Void
Accesses the setTextFormat
method (for TextField instances only).
staticsetTileIndex(this:T, tile:Tile, index:Int):Void
Accesses the setTileIndex
method (for Tilemap instances only).
staticsetTiles(this:T, group:TileContainer):Void
Accesses the setTiles
method (for Tilemap instances only).
staticsortTiles(this:T, compareFunction:(Tile, Tile) ‑> Int):Void
Accesses the sortTiles
method (for Tilemap instances only).
@:value({ bounds : null, lockCenter : false })staticstartDrag(this:T, lockCenter:Bool = false, ?bounds:Rectangle):Void
Accesses the startDrag
method (for Sprite instances only).
staticstopAllMovieClips(this:T):Void
Accesses the stopAllMovieClips
method (for DisplayObjectContainer instances only).
staticswapChildren(this:T, child1:DisplayObject, child2:DisplayObject):Void
Accesses the swapChildren
method (for DisplayObjectContainer instances only).
staticswapChildrenAt(this:T, index1:Int, index2:Int):Void
Accesses the swapChildrenAt
method (for DisplayObjectContainer instances only).
staticswapTiles(this:T, tile1:Tile, tile2:Tile):Void
Accesses the swapTiles
method (for Tilemap instances only).
staticswapTilesAt(this:T, index1:Int, index2:Int):Void
Accesses the swapTilesAt
method (for Tilemap instances only).
staticantiAliasType:AntiAliasType
Accesses the antiAliasType
property (for TextField instances only).
staticread onlycurrentFrameLabel:String
Accesses the currentFrameLabel
property (for MovieClip instances only).
staticread onlycurrentLabel:String
Accesses the currentLabel
property (for MovieClip instances only).
staticread onlycurrentLabels:Array<FrameLabel>
Accesses the currentLabels
property (for MovieClip instances only).
staticdefaultTextFormat:TextFormat
Accesses the defaultTextFormat
property (for TextField instances only).
staticdoubleClickEnabled:Bool
Accesses the doubleClickEnabled
property (for InteractiveObject instances only).
staticread onlydropTarget:DisplayObject
Accesses the dropTarget
property (for Sprite instances only).
staticread onlygraphics:Graphics
Accesses the graphics
property (for Shape or Sprite instances only).
staticmouseChildren:Bool
Accesses the mouseChildren
property (for DisplayObjectContainer instances only).
staticneedsSoftKeyboard:Bool
Accesses the needsSoftKeyboard
property (for InteractiveObject instances only).
staticread onlynumChildren:Int
Accesses the numChildren
property (for DisplayObjectContainer instances only).
staticread onlyselectionBeginIndex:Int
Accesses the selectionBeginIndex
property (for TextField instances only).
staticread onlyselectionEndIndex:Int
Accesses the selectionEndIndex
property (for TextField instances only).
staticsoftKeyboardInputAreaOfInterest:Rectangle
Accesses the softKeyboardInputAreaOfInterest
property (for InteractiveObject instances only).
statictabChildren:Bool
Accesses the tabChildren
property (for DisplayObjectContainer instances only).
statictileBlendModeEnabled:Bool
Accesses the tileBlendModeEnabled
property (for Tilemap instances only).
statictileColorTransformEnabled:Bool
Accesses the tileColorTransformEnabled
property (for Tilemap instances only).
staticaddChild(this:T, child:DisplayObject):DisplayObject
Accesses the addChild
method (for DisplayObjectContainer instances only).
staticaddChildAt(this:T, child:DisplayObject, index:Int):DisplayObject
Accesses the addChildAt
method (for DisplayObjectContainer instances only).
@:value({ useWeakReference : false, priority : 0, useCapture : false })staticaddEventListener<T2>(this:T, type:EventType<T2>, listener:T2 ‑> Void, useCapture:Bool = false, priority:Int = 0, useWeakReference:Bool = false):Void
Accesses the addEventListener
method.
staticaddFrameScript(this:T, index:Int, method:() ‑> Void):Void
Accesses the addFrameScript
method (for MovieClip instances only).
staticaddTileAt(this:T, tile:Tile, index:Int):Tile
Accesses the addTileAt
method (for Tilemap instances only).
staticaddTiles(this:T, tiles:Array<Tile>):Array<Tile>
Accesses the addTiles
method (for Tilemap instances only).
staticappendText(this:T, text:String):Void
Accesses the appendText
method (for TextField instances only).
staticareInaccessibleObjectsUnderPoint(this:T, point:Point):Bool
Accesses the areInaccessibleObjectsUnderPoint
method (for DisplayObjectContainer instances only).
staticattachNetStream(this:T, netStream:NetStream):Void
Accesses the attachNetStream
method (for Video instances only).
staticattachTimeline(this:T, timeline:Timeline):Void
Accesses the attachTimeline
method (for MovieClip instances only).
staticcontains(this:T, child:Dynamic):Bool
Accesses the contains
method (for Tilemap or DisplayObjectContainer instances only).
staticgetBounds(this:T, targetCoordinateSpace:DisplayObject):Rectangle
Accesses the getBounds
method.
staticgetCharBoundaries(this:T, charIndex:Int):Rectangle
Accesses the getCharBoundaries
method (for TextField instances only).
staticgetCharIndexAtPoint(this:T, x:Float, y:Float):Int
Accesses the getCharIndexAtPoint
method (for TextField instances only).
staticgetChildAt(this:T, index:Int):DisplayObject
Accesses the getChildAt
method (for DisplayObjectContainer instances only).
staticgetChildByName(this:T, name:String):DisplayObject
Accesses the getChildByName
method (for DisplayObjectContainer instances only).
staticgetChildIndex(this:T, child:DisplayObject):Int
Accesses the getChildIndex
method (for DisplayObjectContainer instances only).
staticgetFirstCharInParagraph(this:T, charIndex:Int):Int
Accesses the getFirstCharInParagraph
method (for TextField instances only).
staticgetLineIndexAtPoint(this:T, x:Float, y:Float):Int
Accesses the getLineIndexAtPoint
method (for TextField instances only).
staticgetLineIndexOfChar(this:T, charIndex:Int):Int
Accesses the getLineIndexOfChar
method (for TextField instances only).
staticgetLineLength(this:T, lineIndex:Int):Int
Accesses the getLineLength
method (for TextField instances only).
staticgetLineMetrics(this:T, lineIndex:Int):TextLineMetrics
Accesses the getLineMetrics
method (for TextField instances only).
staticgetLineOffset(this:T, lineIndex:Int):Int
Accesses the getLineOffset
method (for TextField instances only).
staticgetLineText(this:T, lineIndex:Int):String
Accesses the getLineText
method (for TextField instances only).
staticgetObjectsUnderPoint(this:T, point:Point):Array<DisplayObject>
Accesses the getObjectsUnderPoint
method (for DisplayObjectContainer instances only).
staticgetParagraphLength(this:T, charIndex:Int):Int
Accesses the getParagraphLength
method (for TextField instances only).
@:value({ endIndex : -1, beginIndex : -1 })staticgetTextFormat(this:T, beginIndex:Int = -1, endIndex:Int = -1):TextFormat
Accesses the getTextFormat
method (for TextField instances only).
staticgetTileIndex(this:T, tile:Tile):Int
Accesses the getTileIndex
method (for Tilemap instances only).
@:value({ scene : null })staticgotoAndPlay(this:T, frame:Any, ?scene:String):Void
Accesses the gotoAndPlay
method (for MovieClip instances only).
@:value({ scene : null })staticgotoAndStop(this:T, frame:Any, ?scene:String):Void
Accesses the gotoAndStop
method (for MovieClip instances only).
@:value({ shapeFlag : false })statichitTestPoint(this:T, x:Float, y:Float, shapeFlag:Bool = false):Bool
Accesses the hitTestPoint
method.
staticremoveChild(this:T, child:DisplayObject):DisplayObject
Accesses the removeChild
method (for DisplayObjectContainer instances only).
staticremoveChildAt(this:T, index:Int):DisplayObject
Accesses the removeChildAt
method (for DisplayObjectContainer instances only).
@:value({ endIndex : 0x7FFFFFFF, beginIndex : 0 })staticremoveChildren(this:T, beginIndex:Int = 0, endIndex:Int = 0x7FFFFFFF):Void
Accesses the removeChildren
method (for DisplayObjectContainer instances only).
@:value({ useCapture : false })staticremoveEventListener<T2>(this:T, type:EventType<T2>, listener:T2 ‑> Void, useCapture:Bool = false):Void
Accesses the removeEventListener
method.
staticremoveTile(this:T, tile:Tile):Tile
Accesses the removeTile
method (for Tilemap instances only).
staticremoveTileAt(this:T, index:Int):Tile
Accesses the removeTileAt
method (for Tilemap instances only).
@:value({ endIndex : 0x7fffffff, beginIndex : 0 })staticremoveTiles(this:T, beginIndex:Int = 0, endIndex:Int = 0x7fffffff):Void
Accesses the removeTiles
method (for Tilemap instances only).
staticreplaceSelectedText(this:T, value:String):Void
Accesses the replaceSelectedText
method (for TextField instances only).
staticreplaceText(this:T, beginIndex:Int, endIndex:Int, newText:String):Void
Accesses the replaceText
method (for TextField instances only).
staticrequestSoftKeyboard(this:T):Bool
Accesses the requestSoftKeyboard
method (for InteractiveObject instances only).
staticsetChildIndex(this:T, child:DisplayObject, index:Int):Void
Accesses the setChildIndex
method (for DisplayObjectContainer instances only).
staticsetSelection(this:T, beginIndex:Int, endIndex:Int):Void
Accesses the setSelection
method (for TextField instances only).
@:value({ endIndex : -1, beginIndex : -1 })staticsetTextFormat(this:T, format:TextFormat, beginIndex:Int = -1, endIndex:Int = -1):Void
Accesses the setTextFormat
method (for TextField instances only).
staticsetTileIndex(this:T, tile:Tile, index:Int):Void
Accesses the setTileIndex
method (for Tilemap instances only).
staticsetTiles(this:T, group:TileContainer):Void
Accesses the setTiles
method (for Tilemap instances only).
staticsortTiles(this:T, compareFunction:(Tile, Tile) ‑> Int):Void
Accesses the sortTiles
method (for Tilemap instances only).
@:value({ bounds : null, lockCenter : false })staticstartDrag(this:T, lockCenter:Bool = false, ?bounds:Rectangle):Void
Accesses the startDrag
method (for Sprite instances only).
staticstopAllMovieClips(this:T):Void
Accesses the stopAllMovieClips
method (for DisplayObjectContainer instances only).
staticswapChildren(this:T, child1:DisplayObject, child2:DisplayObject):Void
Accesses the swapChildren
method (for DisplayObjectContainer instances only).
staticswapChildrenAt(this:T, index1:Int, index2:Int):Void
Accesses the swapChildrenAt
method (for DisplayObjectContainer instances only).
staticswapTiles(this:T, tile1:Tile, tile2:Tile):Void
Accesses the swapTiles
method (for Tilemap instances only).
staticswapTilesAt(this:T, index1:Int, index2:Int):Void
Accesses the swapTilesAt
method (for Tilemap instances only).
Available on HTML5
@:keepalpha:Float
Indicates the alpha transparency value of the object specified. Valid +
Available on HTML5
@:keepalpha:Float
Indicates the alpha transparency value of the object specified. Valid
values are 0 (fully transparent) to 1 (fully opaque). The default value is 1.
-Display objects with alpha
set to 0 are active, even though they are invisible.
blendMode:BlendMode
A value from the BlendMode class that specifies which blend mode to use. A
+Display objects with alpha
set to 0 are active, even though they are invisible.
See also:
blendMode:BlendMode
A value from the BlendMode class that specifies which blend mode to use. A
bitmap can be drawn internally in two ways. If you have a blend mode
enabled or an external clipping mask, the bitmap is drawn by adding a
bitmap-filled square shape to the vector render. If you attempt to set
@@ -74,7 +74,7 @@
BlendMode class defines string values you can use. The illustrations in
the table show blendMode
values applied to a circular display
object(2) superimposed on another display object(1).
BlendMode Constant | Illustration | Description |
---|---|---|
BlendMode.NORMAL | The display object appears in front of the background. Pixel values of the display object override those of the background. Where the display object is transparent, the background is visible. | |
BlendMode.LAYER | Forces the creation of a transparency group for the display object. This means that the display object is pre-composed in a temporary buffer before it is processed further. This is done automatically if the display object is pre-cached using bitmap caching or if the display object is a display object container with at least one child object with a blendMode setting other than BlendMode.NORMAL . Not supported under GPU rendering. | |
BlendMode.MULTIPLY | Multiplies the values of the display object constituent colors by the colors of the background color, and then normalizes by dividing by 0xFF, resulting in darker colors. This setting is commonly used for shadows and depth effects. For example, if a constituent color (such as red) of one pixel in the display object and the corresponding color of the pixel in the background both have the value 0x88, the multiplied result is 0x4840. Dividing by 0xFF yields a value of 0x48 for that constituent color, which is a darker shade than the color of the display object or the color of the background. | |
BlendMode.SCREEN | Multiplies the complement (inverse) of the display object color by the complement of the background color, resulting in a bleaching effect. This setting is commonly used for highlights or to remove black areas of the display object. | |
BlendMode.LIGHTEN | Selects the lighter of the constituent colors of the display object and the color of the background (the colors with the larger values). This setting is commonly used for superimposing type. For example, if the display object has a pixel with an RGB value of 0xFFCC33, and the background pixel has an RGB value of 0xDDF800, the resulting RGB value for the displayed pixel is 0xFFF833 (because 0xFF > 0xDD, 0xCC < 0xF8, and 0x33 > 0x00 = 33). Not supported under GPU rendering. | |
BlendMode.DARKEN | Selects the darker of the constituent colors of the display object and the colors of the background (the colors with the smaller values). This setting is commonly used for superimposing type. For example, if the display object has a pixel with an RGB value of 0xFFCC33, and the background pixel has an RGB value of 0xDDF800, the resulting RGB value for the displayed pixel is 0xDDCC00 (because 0xFF > 0xDD, 0xCC < 0xF8, and 0x33 > 0x00 = 33). Not supported under GPU rendering. | |
BlendMode.DIFFERENCE | Compares the constituent colors of the display object with the colors of its background, and subtracts the darker of the values of the two constituent colors from the lighter value. This setting is commonly used for more vibrant colors. For example, if the display object has a pixel with an RGB value of 0xFFCC33, and the background pixel has an RGB value of 0xDDF800, the resulting RGB value for the displayed pixel is 0x222C33 (because 0xFF - 0xDD = 0x22, 0xF8 - 0xCC = 0x2C, and 0x33 - 0x00 = 0x33). | |
BlendMode.ADD | Adds the values of the constituent colors of the display object to the colors of its background, applying a ceiling of 0xFF. This setting is commonly used for animating a lightening dissolve between two objects. For example, if the display object has a pixel with an RGB value of 0xAAA633, and the background pixel has an RGB value of 0xDD2200, the resulting RGB value for the displayed pixel is 0xFFC833 (because 0xAA + 0xDD > 0xFF, 0xA6 + 0x22 = 0xC8, and 0x33 + 0x00 = 0x33). | |
BlendMode.SUBTRACT | Subtracts the values of the constituent colors in the display object from the values of the background color, applying a floor of 0. This setting is commonly used for animating a darkening dissolve between two objects. For example, if the display object has a pixel with an RGB value of 0xAA2233, and the background pixel has an RGB value of 0xDDA600, the resulting RGB value for the displayed pixel is 0x338400 (because 0xDD - 0xAA = 0x33, 0xA6 - 0x22 = 0x84, and 0x00 - 0x33 < 0x00). | |
BlendMode.INVERT | Inverts the background. | |
BlendMode.ALPHA | Applies the alpha value of each pixel of the display object to the background. This requires the blendMode setting of the parent display object to be set to BlendMode.LAYER . For example, in the illustration, the parent display object, which is a white background, has blendMode = BlendMode.LAYER . Not supported under GPU rendering. | |
BlendMode.ERASE | Erases the background based on the alpha value of the display object. This requires the blendMode of the parent display object to be set to BlendMode.LAYER . For example, in the illustration, the parent display object, which is a white background, has blendMode = BlendMode.LAYER . Not supported under GPU rendering. | |
BlendMode.OVERLAY | Adjusts the color of each pixel based on the darkness of the background. If the background is lighter than 50% gray, the display object and background colors are screened, which results in a lighter color. If the background is darker than 50% gray, the colors are multiplied, which results in a darker color. This setting is commonly used for shading effects. Not supported under GPU rendering. | |
BlendMode.HARDLIGHT | Adjusts the color of each pixel based on the darkness of the display object. If the display object is lighter than 50% gray, the display object and background colors are screened, which results in a lighter color. If the display object is darker than 50% gray, the colors are multiplied, which results in a darker color. This setting is commonly used for shading effects. Not supported under GPU rendering. | |
BlendMode.SHADER | N/A | Adjusts the color using a custom shader routine. The shader that is used is specified as the Shader instance assigned to the blendShader property. Setting the blendShader property of a display object to a Shader instance automatically sets the display object's blendMode property to BlendMode.SHADER . If the blendMode property is set to BlendMode.SHADER without first setting the blendShader property, the blendMode property is set to BlendMode.NORMAL . Not supported under GPU rendering. |
cacheAsBitmap:Bool
All vector data for a display object that has a cached bitmap is drawn +
BlendMode Constant | Illustration | Description |
---|---|---|
BlendMode.NORMAL | The display object appears in front of the background. Pixel values of the display object override those of the background. Where the display object is transparent, the background is visible. | |
BlendMode.LAYER | Forces the creation of a transparency group for the display object. This means that the display object is pre-composed in a temporary buffer before it is processed further. This is done automatically if the display object is pre-cached using bitmap caching or if the display object is a display object container with at least one child object with a blendMode setting other than BlendMode.NORMAL . Not supported under GPU rendering. | |
BlendMode.MULTIPLY | Multiplies the values of the display object constituent colors by the colors of the background color, and then normalizes by dividing by 0xFF, resulting in darker colors. This setting is commonly used for shadows and depth effects. For example, if a constituent color (such as red) of one pixel in the display object and the corresponding color of the pixel in the background both have the value 0x88, the multiplied result is 0x4840. Dividing by 0xFF yields a value of 0x48 for that constituent color, which is a darker shade than the color of the display object or the color of the background. | |
BlendMode.SCREEN | Multiplies the complement (inverse) of the display object color by the complement of the background color, resulting in a bleaching effect. This setting is commonly used for highlights or to remove black areas of the display object. | |
BlendMode.LIGHTEN | Selects the lighter of the constituent colors of the display object and the color of the background (the colors with the larger values). This setting is commonly used for superimposing type. For example, if the display object has a pixel with an RGB value of 0xFFCC33, and the background pixel has an RGB value of 0xDDF800, the resulting RGB value for the displayed pixel is 0xFFF833 (because 0xFF > 0xDD, 0xCC < 0xF8, and 0x33 > 0x00 = 33). Not supported under GPU rendering. | |
BlendMode.DARKEN | Selects the darker of the constituent colors of the display object and the colors of the background (the colors with the smaller values). This setting is commonly used for superimposing type. For example, if the display object has a pixel with an RGB value of 0xFFCC33, and the background pixel has an RGB value of 0xDDF800, the resulting RGB value for the displayed pixel is 0xDDCC00 (because 0xFF > 0xDD, 0xCC < 0xF8, and 0x33 > 0x00 = 33). Not supported under GPU rendering. | |
BlendMode.DIFFERENCE | Compares the constituent colors of the display object with the colors of its background, and subtracts the darker of the values of the two constituent colors from the lighter value. This setting is commonly used for more vibrant colors. For example, if the display object has a pixel with an RGB value of 0xFFCC33, and the background pixel has an RGB value of 0xDDF800, the resulting RGB value for the displayed pixel is 0x222C33 (because 0xFF - 0xDD = 0x22, 0xF8 - 0xCC = 0x2C, and 0x33 - 0x00 = 0x33). | |
BlendMode.ADD | Adds the values of the constituent colors of the display object to the colors of its background, applying a ceiling of 0xFF. This setting is commonly used for animating a lightening dissolve between two objects. For example, if the display object has a pixel with an RGB value of 0xAAA633, and the background pixel has an RGB value of 0xDD2200, the resulting RGB value for the displayed pixel is 0xFFC833 (because 0xAA + 0xDD > 0xFF, 0xA6 + 0x22 = 0xC8, and 0x33 + 0x00 = 0x33). | |
BlendMode.SUBTRACT | Subtracts the values of the constituent colors in the display object from the values of the background color, applying a floor of 0. This setting is commonly used for animating a darkening dissolve between two objects. For example, if the display object has a pixel with an RGB value of 0xAA2233, and the background pixel has an RGB value of 0xDDA600, the resulting RGB value for the displayed pixel is 0x338400 (because 0xDD - 0xAA = 0x33, 0xA6 - 0x22 = 0x84, and 0x00 - 0x33 < 0x00). | |
BlendMode.INVERT | Inverts the background. | |
BlendMode.ALPHA | Applies the alpha value of each pixel of the display object to the background. This requires the blendMode setting of the parent display object to be set to BlendMode.LAYER . For example, in the illustration, the parent display object, which is a white background, has blendMode = BlendMode.LAYER . Not supported under GPU rendering. | |
BlendMode.ERASE | Erases the background based on the alpha value of the display object. This requires the blendMode of the parent display object to be set to BlendMode.LAYER . For example, in the illustration, the parent display object, which is a white background, has blendMode = BlendMode.LAYER . Not supported under GPU rendering. | |
BlendMode.OVERLAY | Adjusts the color of each pixel based on the darkness of the background. If the background is lighter than 50% gray, the display object and background colors are screened, which results in a lighter color. If the background is darker than 50% gray, the colors are multiplied, which results in a darker color. This setting is commonly used for shading effects. Not supported under GPU rendering. | |
BlendMode.HARDLIGHT | Adjusts the color of each pixel based on the darkness of the display object. If the display object is lighter than 50% gray, the display object and background colors are screened, which results in a lighter color. If the display object is darker than 50% gray, the colors are multiplied, which results in a darker color. This setting is commonly used for shading effects. Not supported under GPU rendering. | |
BlendMode.SHADER | N/A | Adjusts the color using a custom shader routine. The shader that is used is specified as the Shader instance assigned to the blendShader property. Setting the blendShader property of a display object to a Shader instance automatically sets the display object's blendMode property to BlendMode.SHADER . If the blendMode property is set to BlendMode.SHADER without first setting the blendShader property, the blendMode property is set to BlendMode.NORMAL . Not supported under GPU rendering. |
See also:
cacheAsBitmap:Bool
All vector data for a display object that has a cached bitmap is drawn
to the bitmap instead of the main display. If
cacheAsBitmapMatrix
is null or unsupported, the bitmap is
then copied to the main display as unstretched, unrotated pixels snapped
@@ -105,12 +105,12 @@
number of pixels cannot exceed 16,777,215 pixels.(So, if a bitmap image
is 8,191 pixels wide, it can only be 2,048 pixels high.) In Flash Player 9
and earlier, the limitation is is 2880 pixels in height and 2,880 pixels
-in width.
The cacheAsBitmap
property is best used with movie clips
that have mostly static content and that do not scale and rotate
frequently. With such movie clips, cacheAsBitmap
can lead to
-performance increases when the movie clip is translated(when its x
-and y position is changed).
cacheAsBitmapMatrix:Matrix
If non-null, this Matrix object defines how a display object is rendered when cacheAsBitmap
is set to
+performance increases when the movie clip is translated (when its x
+and y position is changed).
See also:
cacheAsBitmapMatrix:Matrix
If non-null, this Matrix object defines how a display object is rendered when cacheAsBitmap
is set to
true
. The application uses this matrix as a transformation matrix that is applied when rendering the
bitmap version of the display object.
Adobe AIR profile support: This feature is supported on mobile devices, but it is not supported on desktop @@ -144,16 +144,16 @@
Note: The cacheAsBitmapMatrix
property is suitable for 2D transformations. If you need to apply
transformations in 3D, you may do so by setting a 3D property of the object and manipulating its
transform.matrix3D
property. If the application is packaged using GPU mode, this allows the 3D transforms
-to be applied to the object by the GPU. The cacheAsBitmapMatrix
is ignored for 3D objects.
filters:Array<BitmapFilter>
An indexed array that contains each filter object currently associated
+to be applied to the object by the GPU. The cacheAsBitmapMatrix
is ignored for 3D objects.
See also:
filters:Array<BitmapFilter>
An indexed array that contains each filter object currently associated with the display object. The openfl.filters package contains several classes that define specific filters you can use.
Filters can be applied in Flash Professional at design time, or at run
-time by using ActionScript code. To apply a filter by using ActionScript,
+time by using Haxe code. To apply a filter by using Haxe,
you must make a temporary copy of the entire filters
array,
modify the temporary array, then assign the value of the temporary array
back to the filters
array. You cannot directly add a new
filter object to the filters
array.
To add a filter by using ActionScript, perform the following steps +
To add a filter by using Haxe, perform the following steps
(assume that the target display object is named
myDisplayObject
):
myDisplayObject.filters
array
@@ -184,7 +184,7 @@
The openfl.filters package includes classes for filters. For example, to create a DropShadow filter, you would write:
Throws:
ArgumentError | When | ||||
---|---|---|---|---|---|
ArgumentError | When | ||||
ArgumentError | When Except for TextField and Video objects, a display object with no
content(such as an empty sprite) has a height of 0, even if you try to
-set
|
IllegalOperationError | If you are attempting to set this property on an object that was placed on the timeline in the Flash authoring tool. |
---|
opaqueBackground:Null<Int>
Specifies whether the display object is opaque with a certain background color. A transparent bitmap contains alpha channel data and is drawn -transparently. An opaque bitmap has no alpha channel(and renders faster +transparently. An opaque bitmap has no alpha channel (and renders faster than a transparent bitmap). If the bitmap is opaque, you specify its own background color to use.
-If set to a number value, the surface is opaque(not transparent) with +
If set to a number value, the surface is opaque (not transparent) with
the RGB background color that the number specifies. If set to
null
(the default value), the display object has a
transparent background.
The opaque background region is not matched when calling the
hitTestPoint()
method with the shapeFlag
parameter set to true
.
The opaque background region does not respond to mouse events.
read onlyparent:DisplayObjectContainer
Indicates the DisplayObjectContainer object that contains this display +
The opaque background region does not respond to mouse events.
See also:
read onlyparent:DisplayObjectContainer
Indicates the DisplayObjectContainer object that contains this display
object. Use the parent
property to specify a relative path to
display objects that are above the current display object in the display
list hierarchy.
this.parent.parent.alpha = 20;
Throws:
SecurityError | The parent display object belongs to a security
sandbox to which you do not have access. You can
avoid this situation by having the parent movie call
-the |
---|
read onlyroot:DisplayObject
For a display object in a loaded SWF file, the root
property
+the Security.allowDomain()
method.
See also:
read onlyroot:DisplayObject
For a display object in a loaded SWF file, the root
property
is the top-most display object in the portion of the display list's tree
structure represented by that SWF file. For a Bitmap object representing a
loaded image file, the root
property is the Bitmap object
@@ -286,7 +286,7 @@
is a child of the top-most display object in a loaded SWF file.
For example, if you create a new Sprite object by calling the
Sprite()
constructor method, its root
property
-is null
until you add it to the display list(or to a display
+is null
until you add it to the display list (or to a display
object container that is off the display list but that is a child of the
top-most display object in a SWF file).
For a loaded SWF file, even though the Loader object used to load the
@@ -294,12 +294,12 @@
SWF file has its root
property set to itself. The Loader
object does not have its root
property set until it is added
as a child of a display object for which the root
property is
-set.
@:keeprotation:Float
Indicates the rotation of the DisplayObject instance, in degrees, from its +set.
See also:
@:keeprotation:Float
Indicates the rotation of the DisplayObject instance, in degrees, from its
original orientation. Values from 0 to 180 represent clockwise rotation;
values from 0 to -180 represent counterclockwise rotation. Values outside
this range are added to or subtracted from 360 to obtain a value within
the range. For example, the statement my_video.rotation = 450
-is the same as my_video.rotation = 90
.
scale9Grid:Rectangle
The current scaling grid that is in effect. If set to null
,
+is the same as my_video.rotation = 90
.
See also:
scale9Grid:Rectangle
The current scaling grid that is in effect. If set to null
,
the entire display object is scaled normally when any scale transformation
is applied.
When you define the scale9Grid
property, the display
@@ -327,11 +327,11 @@
the registration point. The default registration point is (0,0). 1.0
equals 100% scale.
Scaling the local coordinate system changes the x
and
-y
property values, which are defined in whole pixels.
@:keepscaleY:Float
Indicates the vertical scale (percentage) of an object as applied from the
+y
property values, which are defined in whole pixels.
See also:
@:keepscaleY:Float
Indicates the vertical scale (percentage) of an object as applied from the registration point of the object. The default registration point is (0,0). 1.0 is 100% scale.
Scaling the local coordinate system changes the x
and
-y
property values, which are defined in whole pixels.
scrollRect:Rectangle
The scroll rectangle bounds of the display object. The display object is
+y
property values, which are defined in whole pixels.
See also:
scrollRect:Rectangle
The scroll rectangle bounds of the display object. The display object is
cropped to the size defined by the rectangle, and it scrolls within the
rectangle when you change the x
and y
properties
of the scrollRect
object.
y
property of the
scrollRect
Rectangle object. If the display object is rotated
90° and you scroll it left and right, the display object actually scrolls
-up and down.@:betashader:Shader
BETA**
Applies a custom Shader object to use when rendering this display object (or its children) when using
hardware rendering. This occurs as a single-pass render on this object only, if visible. In order to
apply a post-process effect to multiple display objects at once, enable cacheAsBitmap
or use the
filters
property with a ShaderFilter
read onlystage:Stage
The Stage of the display object. A Flash runtime application has only one
Stage object. For example, you can create and load multiple display
objects into the display list, and the stage
property of each
-display object refers to the same Stage object(even if the display object
+display object refers to the same Stage object (even if the display object
belongs to a loaded SWF file).
If a display object is not added to the display list, its
-stage
property is set to null
.
@:keeptransform:Transform
An object with properties pertaining to a display object's matrix, color
+stage
property is set to null
.
See also:
@:keeptransform:Transform
An object with properties pertaining to a display object's matrix, color
transform, and pixel bounds. The specific properties - matrix,
colorTransform, and three read-only properties
(concatenatedMatrix
, concatenatedColorTransform
,
@@ -395,21 +395,21 @@
is adjusted accordingly, as shown in the following code:
Except for TextField and Video objects, a display object with no
content(such as an empty sprite) has a width of 0, even if you try to set
-width
to a different value.
@:keepx:Float
Indicates the x coordinate of the DisplayObject instance relative
+width
to a different value.
See also:
@:keepx:Float
Indicates the x coordinate of the DisplayObject instance relative to the local coordinates of the parent DisplayObjectContainer. If the object is inside a DisplayObjectContainer that has transformations, it is in the local coordinate system of the enclosing DisplayObjectContainer. Thus, for a DisplayObjectContainer rotated 90° counterclockwise, the DisplayObjectContainer's children inherit a coordinate system that is rotated 90° counterclockwise. The object's coordinates refer to the -registration point position.
@:keepy:Float
Indicates the y coordinate of the DisplayObject instance relative +registration point position.
See also:
@:keepy:Float
Indicates the y coordinate of the DisplayObject instance relative to the local coordinates of the parent DisplayObjectContainer. If the object is inside a DisplayObjectContainer that has transformations, it is in the local coordinate system of the enclosing DisplayObjectContainer. Thus, for a DisplayObjectContainer rotated 90° counterclockwise, the DisplayObjectContainer's children inherit a coordinate system that is rotated 90° counterclockwise. The object's coordinates refer to the -registration point position.
getBounds(targetCoordinateSpace:DisplayObject):Rectangle
Returns a rectangle that defines the area of the display object relative +registration point position.
See also:
getBounds(targetCoordinateSpace:DisplayObject):Rectangle
Returns a rectangle that defines the area of the display object relative
to the coordinate system of the targetCoordinateSpace
object.
Consider the following code, which shows how the rectangle returned can
vary depending on the targetCoordinateSpace
parameter that
@@ -436,8 +436,8 @@
coordinates, respectively.
Parameters:
targetCoordinateSpace | The display object that defines the coordinate system to use. |
---|
Returns:
The rectangle that defines the area of the display object relative
to the targetCoordinateSpace
object's coordinate
-system.
globalToLocal(pos:Point):Point
Converts the point
object from the Stage(global) coordinates
-to the display object's(local) coordinates.
globalToLocal(pos:Point):Point
Converts the point
object from the Stage (global) coordinates
+to the display object's (local) coordinates.
To use this method, first create an instance of the Point class. The
x and y values that you assign represent global coordinates
because they relate to the origin(0,0) of the main display area. Then
@@ -452,17 +452,17 @@
point specified by the x
and y
parameters. The
x
and y
parameters specify a point in the
coordinate space of the Stage, not the display object container that
-contains the display object(unless that display object container is the
+contains the display object (unless that display object container is the
Stage).
Parameters:
x | The x coordinate to test against this object. |
---|---|
y | The y coordinate to test against this object. |
shapeFlag | Whether to check against the actual pixels of the object
( |
Returns:
true
if the display object overlaps or intersects
with the specified point; false
otherwise.
invalidate():Void
Calling the invalidate()
method signals to have the current object
-redrawn the next time the object is eligible to be rendered.
localToGlobal(point:Point):Point
Converts the point
object from the display object's(local)
-coordinates to the Stage(global) coordinates.
localToGlobal(point:Point):Point
Converts the point
object from the display object's (local)
+coordinates to the Stage (global) coordinates.
This method allows you to convert any given x and y coordinates from values that are relative to the origin(0,0) of a -specific display object(local coordinates) to values that are relative to -the origin of the Stage(global coordinates).
+specific display object (local coordinates) to values that are relative to +the origin of the Stage (global coordinates).To use this method, first create an instance of the Point class. The x and y values that you assign represent local coordinates because they relate to the origin of the display object.
diff --git a/openfl/display/DOMRenderer.html b/openfl/display/DOMRenderer.html index e0ecdfe..07e3522 100644 --- a/openfl/display/DOMRenderer.html +++ b/openfl/display/DOMRenderer.html @@ -1,7 +1,7 @@ -Available on all platforms
BETA**
+Available on all platforms
BETA**
The DOMRenderer API exposes support for HTML5 DOM render instructions within the
RenderEvent.RENDER_DOM
event
@SuppressWarnings("checkstyle:Dynamic")applyStyle(parent:DisplayObject, childElement:Dynamic):Void
Applies CSS styles to the specified DOM element, using a DisplayObject as the virtual parent. This helps set the z-order, position and other components for @@ -130,7 +130,7 @@ for a listener that is a nested inner function, the function will be garbage-collected and no longer persistent. If you create references to the -inner function(save it in another variable) then +inner function (save it in another variable) then it is not garbage-collected and stays persistent.
Weak references are supported on some OpenFL diff --git a/openfl/display/DisplayObject.html b/openfl/display/DisplayObject.html index a31eea0..ce702cf 100644 --- a/openfl/display/DisplayObject.html +++ b/openfl/display/DisplayObject.html @@ -1,7 +1,7 @@ -
Available on all platforms
The DisplayObject class is the base class for all objects that can be +