| Package | graphics.drawing |
| Class | public class BubblePen |
| Inheritance | BubblePen RoundedComplexRectanglePen CornerRectanglePen RectanglePen Pen flash.utils.Proxy |
Example :
package examples
{
import graphics.Align;
import graphics.FillStyle;
import graphics.LineStyle;
import graphics.drawing.BubblePen;
import flash.display.Shape;
import flash.display.Sprite;
import flash.display.StageScaleMode;
import flash.events.KeyboardEvent;
import flash.ui.Keyboard;
public class ExampleBubblePen extends Sprite
{
public function ExampleBubblePen()
{
/////////
stage.scaleMode = StageScaleMode.NO_SCALE ;
stage.align = "" ;
stage.addEventListener( KeyboardEvent.KEY_DOWN , keyDown ) ;
/////////
var shape:Shape = new Shape() ;
shape.x = 740 / 2 ;
shape.y = 420 / 2 ;
addChild( shape ) ;
/////////
pen = new BubblePen( shape , 0 , 0, 200, 150, 14, 14, 14 , 14 ) ;
pen.arrowHeight = 15 ;
pen.arrowWidth = 15 ;
pen.arrowMargin = 20 ; // only when a corner radius is 0
pen.align = Align.TOP_RIGHT ;
pen.fill = new FillStyle( 0xFF0000 , 0.5 ) ;
pen.line = new LineStyle( 2, 0xFFFFFF ) ;
pen.draw() ;
}
public var pen:BubblePen ;
public function keyDown( e:KeyboardEvent ):void
{
var code:uint = e.keyCode ;
switch( code )
{
case Keyboard.LEFT :
case Keyboard.NUMPAD_6 :
{
pen.align = Align.LEFT ;
break ;
}
case Keyboard.RIGHT :
case Keyboard.NUMPAD_4 :
{
pen.align = Align.RIGHT ;
break ;
}
case Keyboard.UP :
case Keyboard.NUMPAD_2 :
{
pen.align = Align.TOP ;
break ;
}
case Keyboard.DOWN :
case Keyboard.NUMPAD_8 :
{
pen.align = Align.BOTTOM ;
break ;
}
case Keyboard.SPACE :
{
pen.align = Align.TOP_LEFT ;
break ;
}
case Keyboard.NUMPAD_7 :
{
pen.align = Align.BOTTOM_RIGHT ;
break ;
}
case Keyboard.NUMPAD_9 :
{
pen.align = Align.BOTTOM_LEFT ;
break ;
}
case Keyboard.NUMPAD_1 :
{
pen.align = Align.TOP_RIGHT ;
break ;
}
case Keyboard.NUMPAD_3 :
{
pen.align = Align.TOP_LEFT ;
break ;
}
}
pen.draw() ;
trace( "rectangle area : " + pen.rectangle ) ;
}
}
}
| Property | Defined By | ||
|---|---|---|---|
![]() | align : uint
Determinates the align value of the pen. | Pen | |
| arrowHeight : Number
Determinates the height of the arrow of the bubble. | BubblePen | ||
| arrowMargin : Number
Determinates the margin of the arrow of the bubble. | BubblePen | ||
| arrowWidth : Number
Determinates the margin of the arrow of the bubble. | BubblePen | ||
![]() | bottomLeftRadius : Number
The radius of the bottom-left corner, in pixels. | RoundedComplexRectanglePen | |
![]() | bottomRightRadius : Number
The radius of the bottom-left corner, in pixels. | RoundedComplexRectanglePen | |
![]() | corner : Corner
Determinates the Corner value of this pen. | CornerRectanglePen | |
![]() | cornerRadius : Number
The global corner radius corner, in pixels. | RoundedComplexRectanglePen | |
![]() | fill : IFillStyle
Determinates the fill style object of the pen. | Pen | |
![]() | graphics : *
Specifies the Graphics object belonging to this Shape object, where vector drawing commands can occur. | Pen | |
![]() | height : Number
Defines the height of the shape rectangle. | RectanglePen | |
![]() | line : ILineStyle
Determinates the line style object of the pen. | Pen | |
| maximum : Vector2 [read-only]
The maximum Vector2 object to defines the bottom right point of the rectangle area in the bubble shape. | BubblePen | ||
| minimum : Vector2 [read-only]
The minimum Vector2 object to defines the top left point of the rectangle area in the bubble shape. | BubblePen | ||
| rectangle : Rectangle [override] [read-only]
The Rectangle reference of this pen (use it to defines the rectangle area and not the arrow area of the bubble). | BubblePen | ||
![]() | topLeftRadius : Number
The radius of the upper-left corner, in pixels. | RoundedComplexRectanglePen | |
![]() | topRightRadius : Number
The radius of the upper-right corner, in pixels. | RoundedComplexRectanglePen | |
![]() | useClear : Boolean = true
Indicates if the clear() method is invoked at the end of the draw method. | Pen | |
![]() | useEndFill : Boolean = true
Indicates if the endFill() method is invoked at the end of the draw method. | Pen | |
![]() | width : Number
Defines the width of the shape rectangle. | RectanglePen | |
![]() | x : Number
Defines the x position of the shape rectangle. | RectanglePen | |
![]() | y : Number
Defines the y position of the shape rectangle. | RectanglePen | |
| Method | Defined By | ||
|---|---|---|---|
BubblePen(graphic:*, x:Number = 0, y:Number = 0, width:Number = 0, height:Number = 0, topLeftRadius:Number = 0, topRightRadius:Number = 0, bottomRightRadius:Number = 0, bottomLeftRadius:Number = 0, align:uint = 10)
Creates a new BubblePen instance. | BubblePen | ||
![]() | BF(... arguments):void
Defines a shortcut reference to used the beginBitmapFill method. | Pen | |
![]() | C(... arguments):void
Defines a shortcut reference to used the curveTo method. | Pen | |
![]() | CL():void
Defines a shortcut reference to used the clear method. | Pen | |
![]() | draw(... args):void [override]
Draws the shape. | RectanglePen | |
drawShape():void [override]
This method contains the basic drawing shape algorithm. | BubblePen | ||
![]() | EF():void
Defines a shortcut reference to used the endFill method. | Pen | |
![]() | F(... arguments):void
Defines a shortcut reference to used the beginFill method. | Pen | |
![]() | GF(... arguments):void
Defines a shortcut reference to used the beginGradientFill method. | Pen | |
![]() | GS(... arguments):void
Defines a shortcut reference to used the lineGradientStyle method. | Pen | |
![]() | L(... arguments):void
Defines a shortcut reference to used the lineTo method. | Pen | |
![]() | M(... arguments):void
Defines a shortcut reference to used the moveTo method. | Pen | |
![]() | S(... arguments):void
Defines a shortcut reference to used the lineStyle method. | Pen | |
![]() | setPen(... args):void [override]
Sets the shape options to defined all values to draw the shape. | RoundedComplexRectanglePen | |
| arrowHeight | property |
arrowHeight:NumberDeterminates the height of the arrow of the bubble.
public function get arrowHeight():Number public function set arrowHeight(value:Number):void| arrowMargin | property |
arrowMargin:NumberDeterminates the margin of the arrow of the bubble.
public function get arrowMargin():Number public function set arrowMargin(value:Number):void| arrowWidth | property |
arrowWidth:NumberDeterminates the margin of the arrow of the bubble.
public function get arrowWidth():Number public function set arrowWidth(value:Number):void| maximum | property |
maximum:Vector2 [read-only] The maximum Vector2 object to defines the bottom right point of the rectangle area in the bubble shape.
public function get maximum():Vector2| minimum | property |
minimum:Vector2 [read-only] The minimum Vector2 object to defines the top left point of the rectangle area in the bubble shape.
public function get minimum():Vector2| rectangle | property |
rectangle:Rectangle [read-only] [override] The Rectangle reference of this pen (use it to defines the rectangle area and not the arrow area of the bubble). This property change when the draw() method is invoked.
public function get rectangle():Rectangle| BubblePen | () | Constructor |
public function BubblePen(graphic:*, x:Number = 0, y:Number = 0, width:Number = 0, height:Number = 0, topLeftRadius:Number = 0, topRightRadius:Number = 0, bottomRightRadius:Number = 0, bottomLeftRadius:Number = 0, align:uint = 10)Creates a new BubblePen instance.
Parametersgraphic:* — The Graphics reference to control with this helper. You can passed-in a Shape or Sprite/MovieClip reference in argument.
| |
x:Number (default = 0) — (optional) The x position of the pen. (default 0)
| |
y:Number (default = 0) — (optional) The y position of the pen. (default 0)
| |
width:Number (default = 0) — (optional) The width of the pen. (default 0)
| |
height:Number (default = 0) — (optional) The height of the pen. (default 0)
| |
topLeftRadius:Number (default = 0) — (optional) The radius of the upper-left corner, in pixels. (default 0)
| |
topRightRadius:Number (default = 0) — (optional) The radius of the upper-right corner, in pixels. (default 0)
| |
bottomRightRadius:Number (default = 0) — (optional) The radius of the bottom-left corner, in pixels. (default 0)
| |
bottomLeftRadius:Number (default = 0) — (optional) The radius of the bottom-right corner, in pixels. (default 0)
| |
align:uint (default = 10) — (optional) The align value of the pen. (default Align.TOP_LEFT)
|
| drawShape | () | method |
override public function drawShape():voidThis method contains the basic drawing shape algorithm.