Beispiel #1
0
    protected void SetupWelcomeTitle()
    {
        Texture2D titleTex    = TextureResources.Get("LogoMixed");
        float     aspectR     = titleTex.Width / (float)titleTex.Height;
        int       titleWidth  = windowWidth * 3 / 4;
        int       titleHeight = (int)(titleWidth / aspectR);
        int       titleX      = (windowWidth - titleWidth) / 2;
        int       titleY      = (windowHeight - titleHeight) / 16;
        AlphaAnimatedVisibleBoardElement title = new AlphaAnimatedVisibleBoardElement(new Rectangle(titleX, titleY, titleWidth, titleHeight), titleTex, "welcometitle", 21);

        CommandQueue.Queue(new AddToBoardCommand(title));
    }
Beispiel #2
0
    protected AlphaAnimatedVisibleBoardElement SetupBackground(string uid, int zPosition, float alpha = 1f)
    {
        Texture2D background            = TextureResources.Get("Background");
        float     backgroundAspectRatio = background.Width / (float)background.Height;
        int       backgroundWidth       = windowWidth;
        int       backgroundHeight      = (int)(backgroundWidth / backgroundAspectRatio);
        int       backgroundX           = (windowWidth - backgroundWidth) / 2;
        int       backgroundY           = (windowHeight - backgroundHeight) / 2;
        AlphaAnimatedVisibleBoardElement backgroundBoardEl = new AlphaAnimatedVisibleBoardElement(new Rectangle(backgroundX, backgroundY, backgroundWidth, backgroundHeight), background, uid, zPosition: zPosition, startAlpha: alpha);

        CommandQueue.Queue(new AddToBoardCommand(backgroundBoardEl));
        return(backgroundBoardEl);
    }
Beispiel #3
0
 private void RemoveFromBoard(AlphaAnimatedVisibleBoardElement alphaElement)
 {
     CommandQueue.Queue(new RemoveFromBoardCommand(alphaElement));
 }