コード例 #1
0
    public Question(Rectangle position, string UID)
        : base(position, TextureResources.Get("QuestionBackground"), UID, defaultZPosition)
    {
        isConstructed = false;

        margin      = UnitConvert.ToAbsoluteWidth(30);
        contentRect = new Rectangle(position.X + margin, position.Y + margin, position.Width - margin * 2, position.Height - margin * 2);
    }
コード例 #2
0
    protected void SetupImpressum()
    {
        string           text        = "Impressum: Developed by Lorenz Gonsa, FHS MMT for MultiMediaProject 1. The great background illustration is designed by vectorpouch / Freepik   ";
        SpriteFont       font        = FontResources.oldenburg_8;
        Vector2          textSize    = font.MeasureString(text);
        int              margin      = UnitConvert.ToAbsoluteWidth(5);
        Rectangle        impressRect = new Rectangle(windowWidth - (int)textSize.X - margin, windowHeight - (int)textSize.Y - margin, (int)textSize.X + margin, (int)textSize.Y + margin);
        TextBoardElement impressum   = new TextBoardElement(impressRect, text, font, "impressum", ColorResources.Black, 21, TextBoardElement.Alignment.LeftTop);

        CommandQueue.Queue(new AddToBoardCommand(impressum));
    }
コード例 #3
0
    protected void SetupPlayButton()
    {
        Texture2D btnTex               = TextureResources.Get("Play");
        float     aspectR              = btnTex.Width / (float)btnTex.Height;
        int       btnWidth             = UnitConvert.ToAbsoluteWidth(300);
        int       btnHeight            = (int)(btnWidth / aspectR);
        int       btnX                 = (windowWidth - btnWidth) / 2;
        int       btnY                 = (windowHeight - btnHeight) * 7 / 8;
        PlayButtonBoardElement playBtn = new PlayButtonBoardElement(new Rectangle(btnX, btnY, btnWidth, btnHeight), btnTex, "btn_play", 22, "welcomebackground", "welcometitle", "impressum");

        CommandQueue.Queue(new AddToBoardCommand(playBtn));
    }
コード例 #4
0
    protected void SetupNamePlates()
    {
        int           margin            = UnitConvert.ToAbsoluteWidth(20);
        Rectangle     namePlateRectFoes = new Rectangle(boardRect.Right + margin, boardRect.Top + margin, ((windowWidth - boardRect.Width) / 2) - margin - margin, windowHeight / 2);
        NamePlateFoes namePlateFoes     = new NamePlateFoes(namePlateRectFoes, FontResources.oldenburg_20, FontResources.oldenburg_30, "namePlateFoes", 1);

        Rectangle      namePlateRectLocal = new Rectangle(margin, boardRect.Top + margin, ((windowWidth - boardRect.Width) / 2) - margin - margin, windowHeight / 4);
        NamePlateLocal namePlateLocal     = new NamePlateLocal(namePlateRectLocal, FontResources.oldenburg_20, FontResources.oldenburg_30, "namePlateLocal", 1);

        PlayerManager.Instance().AddObserver(namePlateFoes);
        PlayerManager.Instance().AddObserver(namePlateLocal);

        MeepleColorClaimer.Instance().AddObserver(namePlateFoes);
        MeepleColorClaimer.Instance().AddObserver(namePlateLocal);

        CommandQueue.Queue(new AddToBoardCommand(namePlateFoes, namePlateLocal));
    }
コード例 #5
0
    private QuestionManager()
    {
        int   margin = UnitConvert.ToAbsoluteWidth(20);
        Point size   = new Point(Game1.windowHeight + margin * 2, Game1.windowHeight - margin);
        Point pos    = new Point((Game1.windowWidth - size.X) / 2, margin / 2);

        questionRect = new Rectangle(pos, size);

        questions = new List <Question>();
        ParseQuestions();

        random = new Random();

        questionElems = new List <QuestionBoardElement>();
        floorElems    = new List <PyramidFloorBoardElement>();

        movingQBEOffset = new Point(1, 1);
    }