Package | twaver.network.ui |
Class | public class Attachment |
Inheritance | Attachment ![]() |
Subclasses | BasicAttachment, EditAttachment, IconsAttachment |
You can write a new subclass to create customized attachment.
You can create attachment to display text, graphic, UIComponent,
picture, GIF image, or even swf resource. However, class
BasicAttachment
implements most needed functions so it
always a better idea to extends subclasses from class
BasicAttachment
.
Property | Defined By | ||
---|---|---|---|
attachmentSprite : Sprite | Attachment | ||
attachmentSpriteTransform : Transform | Attachment | ||
bounds : Rectangle [read-only]
Get attachment bounds. | Attachment | ||
element : IElement [read-only]
Get element ui related element object. | Attachment | ||
elementUI : ElementUI [read-only]
Get connected element ui. | Attachment | ||
network : Network [read-only]
Get network component this attachment display on. | Attachment | ||
showInAttachmentCanvas : Boolean [read-only]
Get value whether show this attachment a the separate
attachment canvas in network. | Attachment |
Method | Defined By | ||
---|---|---|---|
Attachment(elementUI:ElementUI, showInAttachmentCanvas:Boolean = false)
Attachment constructor. | Attachment | ||
dispose():void
Call this to dispose all resources used by this attachment. | Attachment | ||
draw(graphics:Graphics):void
Draw attachment content. | Attachment | ||
setMatrix(matrix:Matrix):void
Set attachment transform matrix. | Attachment | ||
updateAlpha():void
Update attachment transparency. | Attachment | ||
updateProperties():void
Update element attachment properties. | Attachment |
Method | Defined By | ||
---|---|---|---|
createFilters():Array
Create filters. | Attachment | ||
measure():void [override]
| Attachment |
attachmentSprite | property |
public var attachmentSprite:Sprite
attachmentSpriteTransform | property |
public var attachmentSpriteTransform:Transform
bounds | property |
bounds:Rectangle
[read-only] Get attachment bounds.
public function get bounds():Rectangle
element | property |
element:IElement
[read-only] Get element ui related element object.
public function get element():IElement
elementUI | property |
elementUI:ElementUI
[read-only] Get connected element ui.
public function get elementUI():ElementUI
network | property |
network:Network
[read-only] Get network component this attachment display on.
public function get network():Network
showInAttachmentCanvas | property |
showInAttachmentCanvas:Boolean
[read-only]
Get value whether show this attachment a the separate
attachment canvas in network. See class Network
to know more about the network internal canvas hierarchy. Because
attachment canvas is in front of other canvas, so this attachment
will not covered by other element body if set this value to true.
Default value here is false.
public function get showInAttachmentCanvas():Boolean
See also
Attachment | () | Constructor |
public function Attachment(elementUI:ElementUI, showInAttachmentCanvas:Boolean = false)
Attachment constructor. Create an attachment for specified element ui.
ParameterselementUI:ElementUI — the element ui contains this attachment.
| |
showInAttachmentCanvas:Boolean (default = false ) — whether show this attachment a the separate
attachment canvas in network. See class Network
to know more about the network internal canvas hierarchy. Because
attachment canvas is in front of other canvas, so this attachment
will not covered by other element body if set this value to true.
Default value here is false.
|
See also
createFilters | () | method |
protected function createFilters():Array
Create filters.
ReturnsArray — create filters in an array.
|
dispose | () | method |
public function dispose():void
Call this to dispose all resources used by this attachment.
draw | () | method |
public function draw(graphics:Graphics):void
Draw attachment content. Subclass should overwrite this function to draw own attachment content.
Parameters
graphics:Graphics — the graphics attachment will draw on.
|
measure | () | method |
override protected final function measure():void
setMatrix | () | method |
public function setMatrix(matrix:Matrix):void
Set attachment transform matrix.
Parameters
matrix:Matrix — attachment transform matrix.
|
updateAlpha | () | method |
public function updateAlpha():void
Update attachment transparency.
updateProperties | () | method |
public function updateProperties():void
Update element attachment properties. This will redraw attachment.