Line | |
---|
1 | package elements.labels {
|
---|
2 | import org.flashdevelop.utils.FlashConnect;
|
---|
3 | import string.Css;
|
---|
4 |
|
---|
5 | public class XLegend extends BaseLabel {
|
---|
6 |
|
---|
7 | public function XLegend( json:Object )
|
---|
8 | {
|
---|
9 | super();
|
---|
10 |
|
---|
11 | if( !json )
|
---|
12 | return;
|
---|
13 |
|
---|
14 | object_helper.merge_2( json, this );
|
---|
15 |
|
---|
16 | this.css = new Css( this.style );
|
---|
17 |
|
---|
18 | // call our parent constructor:
|
---|
19 | this.build( this.text );
|
---|
20 | }
|
---|
21 |
|
---|
22 |
|
---|
23 | public function resize( sc:ScreenCoords ):void {
|
---|
24 | if ( this.text == null )
|
---|
25 | return;
|
---|
26 |
|
---|
27 | // this will center it in the X
|
---|
28 | // this will align bottom:
|
---|
29 | this.x = sc.left + ( (sc.width/2) - (this.get_width()/2) );
|
---|
30 | //this.getChildAt(0).width = this.stage.stageWidth;
|
---|
31 | this.getChildAt(0).y = this.stage.stageHeight - this.getChildAt(0).height;
|
---|
32 | }
|
---|
33 |
|
---|
34 | //
|
---|
35 | // this is only here while title has CSS and x legend does not.
|
---|
36 | // remove this when we put css in this object
|
---|
37 | //
|
---|
38 | public function get_height():Number{
|
---|
39 | // the title may be turned off:
|
---|
40 | return this.height;
|
---|
41 | }
|
---|
42 |
|
---|
43 | }
|
---|
44 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.