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)); }
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); }
private void RemoveFromBoard(AlphaAnimatedVisibleBoardElement alphaElement) { CommandQueue.Queue(new RemoveFromBoardCommand(alphaElement)); }