import {Game} from "@engine/core/game";
import {LAYOUT_SIZE} from "@engine/model/impl/ui/generic/container";
import {Color} from "@engine/core/renderer/color";


export class MainView {

    public static build(game:Game){
        return game.uiBuilder.build({
            AbsoluteLayout: {
                pos:{x:0,y:0},
                width:game.width,
                height:game.height,
                layoutWidth: LAYOUT_SIZE.FIXED,
                layoutHeight: LAYOUT_SIZE.FIXED,
                children: [
                    {
                      Image: {
                          pos: {x:0,y:0},
                          src:'resources/board.png'
                      }
                    },
                    {
                        Image: {
                            pos: {x:0,y:0},
                            src:'resources/top.png'
                        }
                    },
                    {
                        AbsoluteLayout: {
                            id: 'mainFrame',
                            pos: {x: 110, y:100},
                            width: 460,
                            height: 260,
                            layoutWidth: LAYOUT_SIZE.FIXED,
                            layoutHeight: LAYOUT_SIZE.FIXED,
                            background: {
                                Rectangle: {
                                    lineWidth: 5,
                                    borderRadius: 1,
                                    color: {r: 0, g: 0, b: 12},
                                    fillColor: Color.NONE
                                }
                            }
                        }
                    }
                ]
            }

        });
    }

}