public Score() { //asd.Font font = asd.Engine.Graphics.CreateFont("Resources/Font.aff"); asd.Font font = asd.Engine.Graphics.CreateDynamicFont(@"C:\WINDOWS\FONTS\MSGOTHIC.TTC", 24, new asd.Color(0, 0, 0, 255), 1, new asd.Color(255, 255, 255, 255)); Font = font; }
protected override void OnRegistered() { AddLayer(layer); asd.TextureObject2D title = new asd.TextureObject2D(); title.Texture = asd.Engine.Graphics.CreateTexture2D("Resources/title.png"); layer.AddObject(title); toStart = true; asd.Font font = asd.Engine.Graphics.CreateFont("Resources/font3.aff"); start.Font = font; start.Text = "START"; start.CenterPosition = new asd.Vector2DF(start.Text.Length * 30 / 2, 0); start.Position = new asd.Vector2DF(asd.Engine.WindowSize.X / 2, asd.Engine.WindowSize.Y * 2 / 3); start.Color = new asd.Color(0, 180, 255, 200); exit.Font = font; exit.Text = "EXIT"; exit.CenterPosition = new asd.Vector2DF(exit.Text.Length * 32 / 2, 0); exit.Position = new asd.Vector2DF(asd.Engine.WindowSize.X / 2, asd.Engine.WindowSize.Y * 3 / 4); exit.Color = new asd.Color(0, 180, 255, 40); layer.AddObject(start); layer.AddObject(exit); }
public static asd.Font getFontRed() { if (_fonRedt == null) { _fonRedt = asd.Engine.Graphics.CreateFont("fontRed.aff"); } return(_fonRedt); }
public static asd.Font getPaletteFont() { if (_fontPalette == null) { _fontPalette = asd.Engine.Graphics.CreateFont("paletteFont.aff"); } return(_fontPalette); }
public Button(string text, float x, float y, int fontsize, asd.Color color) { font = asd.Engine.Graphics.CreateDynamicFont(string.Empty, fontsize, color, 1, new asd.Color(255, 255, 255, 255)); Font = font; size = font.CalcTextureSize(text, asd.WritingDirection.Horizontal); CenterPosition = new asd.Vector2DF(size.X / 2.0f, size.Y / 2.0f); Position = new asd.Vector2DF(x, y); Text = text; }
public ScoreWindow() { window.Texture = asd.Engine.Graphics.CreateTexture2D("Resources/score_window.png"); window.Position = new asd.Vector2DF(asd.Engine.WindowSize.X * 2 / 3, 0); asd.Font font = asd.Engine.Graphics.CreateFont("Resources/font.aff"); score.Font = font; score.Text = "Score"; score.Position = window.Position + new asd.Vector2DF(window.Texture.Size.X / 8.0f, window.Texture.Size.Y / 4.0f); point.Font = font;//asd.Engine.Graphics.CreateFont("Resources/font2.aff"); point.Position = score.Position + new asd.Vector2DF(asd.Engine.WindowSize.To2DF().Normal.X * 80, asd.Engine.WindowSize.To2DF().Normal.Y * 200); }
public GameManager() { font = asd.Engine.Graphics.CreateDynamicFont(string.Empty, 35, new asd.Color(255, 255, 255, 255), 1, new asd.Color(255, 255, 255, 255)); conftext.Font = font; conftext.Position = new asd.Vector2DF(asd.Engine.WindowSize.X / 2.0f, asd.Engine.WindowSize.Y * 0.35f); yes.Text = ""; no.Text = ""; confirmation.AddObject(conftext); confirmation.AddObject(yes); confirmation.AddObject(no); }
private string GetWrappedString(asd.Font font, string title) { string result = title; if (font.CalcTextureSize(result, asd.WritingDirection.Horizontal).X <= Size.X) { return(result); } while (font.CalcTextureSize(result + "…", asd.WritingDirection.Horizontal).X > Size.X) { result = result.Substring(0, result.Length - 1); } return(result + "…"); }
private MapEventResource() { MessageBoxTexture = TextureManager.LoadTexture("Static/messageBox.png"); NameBoxTexture = TextureManager.LoadTexture("Static/nameBox.png"); MessageFont = asd.Engine.Graphics.CreateFont("Static/messageFont.aff"); if (MessageFont == null) { Logger.Warning("MessageFont doesn't exist."); MessageFont = asd.Engine.Graphics.CreateDynamicFont("", 25, new asd.Color(255, 255, 255), 0, new asd.Color()); } NameFont = asd.Engine.Graphics.CreateFont("Static/nameFont.aff"); if (NameFont == null) { Logger.Warning("NameFont doesn't exist."); NameFont = asd.Engine.Graphics.CreateDynamicFont("", 30, new asd.Color(255, 255, 255), 0, new asd.Color()); } }
internal void DrawTextAdditionally_(asd.Vector2DF pos, asd.Color color, asd.Font font, string text, asd.WritingDirection writingDirection, asd.AlphaBlendMode alphaBlend, int priority) { base.DrawTextAdditionally( pos, color, font, text, writingDirection, alphaBlend, priority); }
public GameOverScene(string message) { asd.Layer2D layer = new asd.Layer2D(); asd.Font font48 = asd.Engine.Graphics.CreateDynamicFont("", 48, new asd.Color(255, 255, 255, 255), 2, new asd.Color(255, 100, 100, 255)); asd.Font font12 = asd.Engine.Graphics.CreateDynamicFont("", 12, new asd.Color(255, 255, 255, 255), 0, new asd.Color(0, 0, 0, 0)); asd.TextObject2D title = new asd.TextObject2D(); title.Font = font48; title.Text = message; float titleWidth = font48.CalcTextureSize(title.Text, asd.WritingDirection.Horizontal).X; title.Position = new asd.Vector2DF((asd.Engine.WindowSize.To2DF().X - titleWidth) / 2, 250); layer.AddObject(title); asd.TextObject2D prompt = new asd.TextObject2D(); prompt.Font = font12; prompt.Text = "PRESS SPACE KEY TO TITLE"; float promptWidth = font12.CalcTextureSize(prompt.Text, asd.WritingDirection.Horizontal).X; prompt.Position = new asd.Vector2DF((asd.Engine.WindowSize.To2DF().X - promptWidth) / 2, 400); layer.AddObject(prompt); AddLayer(layer); }
static public void Init() { Font = asd.Engine.Graphics.CreateDynamicFont("", 16, new asd.Color(0, 0, 0), 0, new asd.Color(0, 0, 0)); OptionFont = asd.Engine.Graphics.CreateDynamicFont("", 32, new asd.Color(0, 0, 0), 1, new asd.Color(255, 255, 255)); }
static public void Init() { CharactorGraph = asd.Engine.Graphics.CreateTexture2D("Resource/charactors.png"); Font = asd.Engine.Graphics.CreateDynamicFont("Resource/PixelMplus10-Regular.ttf", 16, new asd.Color(255, 255, 255), 0, new asd.Color()); }
public Money() { asd.Font font = asd.Engine.Graphics.CreateDynamicFont("font.ttf", 24, new asd.Color(255, 255, 255, 255), 1, new asd.Color(0, 0, 0, 255)); Font = font; Position = new asd.Vector2DF(600, 740); }
/// <summary> /// 描画テキストの縦方向の描画領域を計算する。 /// </summary> public static asd.Vector2DI VerticalSize(this asd.Font obj, string text) { return(obj.CalcTextureSize(text, asd.WritingDirection.Vertical)); }
public WindowContainer(Style style) { Windows = new LinkedList <Window>(); Style = style; Font = asd.Engine.Graphics.CreateDynamicFont(string.Empty, 12, Style.FontColor, 0, new asd.Color(255, 255, 255)); }
public void SetStrArray_FontAndInstance(int num, asd.TextObject2D[] textObject2D, asd.Layer2D layer, asd.Font font) { for (int n = 0; n < num; n++) { textObject2D[n] = new asd.TextObject2D(); textObject2D[n].Font = font; layer.AddObject(textObject2D[n]); } }