public override void Draw(GameTime gameTime, SpriteBatch spriteBatch) { if (Disposed) { return; } var k = TextRows; var g = MaxTextDimensions(); spriteBatch.Draw(_shadowTexture, destinationRectangle: ShadowRectangle, color: Color.White); spriteBatch.Draw(_texture, destinationRectangle: Rectangle, color: Color.White); spriteBatch.Draw(_texture, destinationRectangle: TopBarRectangle, color: Color.White); CloseButton.Draw(gameTime, spriteBatch); if (!string.IsNullOrEmpty(Text)) { int i = 0; foreach (var row in TextRows) { // calculate text position and sheit var txt_pos = TextStartPosition; txt_pos += new Vector2(0, i * _font.MeasureString(row).Y); // middle of the text, betch var txt_origin = new Vector2(_font.MeasureString(row).X / 2, _font.MeasureString(row).Y / 2); var txt_scale = new Vector2(1, 1); spriteBatch.DrawString(_font, row, txt_pos, TextColor, 0f, txt_origin, txt_scale, SpriteEffects.None, 1f); i++; } } }
public void Draw() { if (!IsVisible) { return; } DX.DrawBox(X - 1, Y - 1, X + Width + 1, Y + Height + 1, WindowBaseColor, DX.TRUE); DX.DrawBox(X - 1, Y - 1, X + Width + 1, Y + Height + 1, WindowFrameColor, DX.FALSE); ReloadButton.Draw(); CloseButton.Draw(); if (!IsHaveInfo) { FontAsset.Draw(TextFont, "Please Reload", X + Width / 2 - FontAsset.GetDrawTextWidth(TextFont, "Please Reload") / 2, Y + 60, TextColor ); } else if (IsReloading) { FontAsset.Draw(TextFont, "Loading...", X + Width / 2 - FontAsset.GetDrawTextWidth(TextFont, "Loading...") / 2, Y + 60, TextColor ); } else { foreach (var button in MatchesListButtons) { button.Draw(); button.DrawText(); } } }
/// <summary> /// ゲームシーンの描画処理 /// </summary> public void Draw() { SugorokuFrame.Draw(); DiceButton.Draw(); DiceButton.MouseOverDraw(); DiceTexture.Draw(); MyPlayer.Draw(); MyPlayerText.DrawText(); FontAsset.Draw(MessageTextFont, MessageText, 0, 800, DX.GetColor(50, 50, 50)); if (state == State.DrawRanking) { SugorokuFrame.Draw(); CloseButton.Draw(); CloseButton.DrawText(); } }