public virtual void CreateUI(GLEx g) { if (visible) { LFont oldFont = g.GetFont(); Color oldColor = g.GetColor(); g.SetFont(font); g.SetColor(color); this.width = font.StringWidth(label); this.height = font.GetSize(); if (alpha > 0 && alpha < 1) { g.SetAlpha(alpha); g.DrawString(label, X(), Y() - font.GetAscent()); g.SetAlpha(1.0F); } else { g.DrawString(label, X(), Y() - font.GetAscent()); } g.SetFont(oldFont); g.SetColor(oldColor); } }
public override void CreateUI(GLEx g, int x, int y, LComponent component, LTexture[] buttonImage) { LButton button = (LButton)component; if (buttonImage != null) { if (!button.IsEnabled()) { g.DrawTexture(buttonImage[3], x, y); } else if (button.IsTouchPressed()) { g.DrawTexture(buttonImage[2], x, y); } else if (button.IsTouchOver()) { g.DrawTexture(buttonImage[1], x, y); } else { if (type == 1) { g.DrawTexture(buttonImage[0], x, y, LColor.gray); } else { g.DrawTexture(buttonImage[0], x, y); } } } if (text != null) { LFont old = g.GetFont(); g.SetFont(font); g.SetColor(fontColor); g.DrawString( text, x + button.GetOffsetLeft() + (button.GetWidth() - font.StringWidth(text)) / 2, y + button.GetOffsetTop() + (button.GetHeight() - font.GetLineHeight()) / 2 + font.GetLineHeight()); g.SetFont(old); g.ResetColor(); } }
protected override void CreateCustomUI(GLEx g, int x, int y, int w, int h) { if (!visible) { return; } LFont oldFont = g.GetFont(); g.SetFont(messageFont); print.Draw(g, fontColor); g.SetFont(oldFont); if (print.IsComplete() && animation != null) { if (animation.GetSpriteImage() != null) { g.SetAlpha(1.0F); UpdateIcon(); g.DrawTexture(animation.GetSpriteImage(), dx, dy); } } g.ResetColor(); }