onAddedToEntity() public method

public onAddedToEntity ( ) : void
return void
Exemplo n.º 1
0
        void prepCanvas()
        {
            _skin = Skin.createDefaultSkin();
            var tfs = _skin.get <TextFieldStyle>();

            tfs.background.leftWidth    = tfs.background.rightWidth = 4;
            tfs.background.bottomHeight = 0;
            tfs.background.topHeight    = 3;

            var checkbox = _skin.get <CheckBoxStyle>();

            checkbox.checkboxOn.minWidth   = checkbox.checkboxOn.minHeight = 15;
            checkbox.checkboxOff.minWidth  = checkbox.checkboxOff.minHeight = 15;
            checkbox.checkboxOver.minWidth = checkbox.checkboxOver.minHeight = 15;

            // since we arent using this as a Component on an Entity we'll fake it here
            ui        = new UICanvas();
            ui.entity = entity;
            ui.onAddedToEntity();
            ui.stage.isFullScreen = true;

            _table = ui.stage.addElement(new Table());
            _table.setWidth(300);
            _table.setHeight(Screen.height);
            _table.top().right();
            _table.defaults().setPadTop(5).setPadRight(5).setAlign(Align.left);
            _table.setBackground(new PrimitiveDrawable(new Color(40, 40, 40, 255)));
        }
Exemplo n.º 2
0
        void prepCanvas()
        {
            _skin = Skin.createDefaultSkin();

            // modify some of the default styles to better suit our needs
            var tfs = _skin.get <TextFieldStyle>();

            tfs.background.leftWidth    = tfs.background.rightWidth = 4;
            tfs.background.bottomHeight = 0;
            tfs.background.topHeight    = 3;

            var checkbox = _skin.get <CheckBoxStyle>();

            checkbox.checkboxOn.minWidth   = checkbox.checkboxOn.minHeight = 15;
            checkbox.checkboxOff.minWidth  = checkbox.checkboxOff.minHeight = 15;
            checkbox.checkboxOver.minWidth = checkbox.checkboxOver.minHeight = 15;

            // since we arent using this as a Component on an Entity we'll fake it here
            ui = new UICanvas();
            ui.onAddedToEntity();
            ui.stage.isFullScreen = true;

            _table = new Table();
            _table.top().left();
            _table.defaults().setPadTop(4).setPadLeft(4).setPadRight(0).setAlign(Align.left);
            _table.setBackground(new PrimitiveDrawable(new Color(40, 40, 40)));

            // wrap up the table in a ScrollPane
            _scrollPane = ui.stage.addElement(new ScrollPane(_table, _skin));
            // force a validate which will layout the ScrollPane and populate the proper scrollBarWidth
            _scrollPane.validate();
            _scrollPane.setSize(400 + _scrollPane.getScrollBarWidth(), Screen.height);
        }
Exemplo n.º 3
0
        void prepCanvas()
        {
            _skin = Skin.createDefaultSkin();

            // modify some of the default styles to better suit our needs
            var tfs = _skin.get<TextFieldStyle>();
            tfs.background.leftWidth = tfs.background.rightWidth = 4;
            tfs.background.bottomHeight = 0;
            tfs.background.topHeight = 3;

            var checkbox = _skin.get<CheckBoxStyle>();
            checkbox.checkboxOn.minWidth = checkbox.checkboxOn.minHeight = 15;
            checkbox.checkboxOff.minWidth = checkbox.checkboxOff.minHeight = 15;
            checkbox.checkboxOver.minWidth = checkbox.checkboxOver.minHeight = 15;

            // since we arent using this as a Component on an Entity we'll fake it here
            ui = new UICanvas();
            ui.onAddedToEntity();
            ui.stage.isFullScreen = true;

            _table = new Table();
            _table.top().left();
            _table.defaults().setPadTop( 4 ).setPadLeft( 4 ).setPadRight( 0 ).setAlign( Align.left );
            _table.setBackground( new PrimitiveDrawable( new Color( 40, 40, 40 ) ) );

            // wrap up the table in a ScrollPane
            _scrollPane = ui.stage.addElement( new ScrollPane( _table, _skin ) );
            // force a validate which will layout the ScrollPane and populate the proper scrollBarWidth
            _scrollPane.validate();
            _scrollPane.setSize( 295 + _scrollPane.getScrollBarWidth(), Screen.height );
        }