~extremepopcorn/dhlib/dhlib_ep

« back to all changes in this revision

Viewing changes to app-dicey/dicey/LevelDisplay.mhx

  • Committer: edA-qa mort-ora-y
  • Date: 2010-02-16 05:36:32 UTC
  • Revision ID: eda-qa@disemia.com-20100216053632-60lt7fndfi3fgblw
first

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* <license>
 
2
 * This file is part of the dis-Emi-A HaXe Library. Copyright © edA-qa mort-ora-y
 
3
 * For full copyright and license information please refer to doc/license.txt.
 
4
 * </license> 
 
5
 */
 
6
package dicey;
 
7
 
 
8
import DrawBasicTypes;
 
9
 
 
10
class LevelDisplay extends ui.AnimatedWidget
 
11
{
 
12
        var game : Game;
 
13
        var bar : ui.DotBar;
 
14
        
 
15
        public function new( game : Game )
 
16
        {
 
17
                super();
 
18
                this.game = game;
 
19
                
 
20
                bar = ui.DotBar.simple( 
 
21
                        20, 1,
 
22
                        draw.fragments.Polygon.shape( {
 
23
                                        sides: 4,
 
24
                                        angleStart: Math.PI/4,
 
25
                                        pen : Pen.solid( 2, Color.rgb( 1, 1, 0.8 ) ),
 
26
                                        brush : Brush.solid( Color.rgb( 0.5, 1, 0.5 ), 0.5 )
 
27
                                })
 
28
                        );
 
29
                addChild( bar );
 
30
        }
 
31
        
 
32
        override function _animate( elapsed : Float )
 
33
        {
 
34
                bar.setNumActive( game.level );
 
35
        }
 
36
        
 
37
        override function _resize( w : Float, h : Float )
 
38
        {
 
39
                bar.resize( w, h );
 
40
        }
 
41
}