public virtual void Draw(GLEx g) { if (exist) { rain.Draw(x, y); } }
public override void CreateUI(GLEx g, int x, int y, LComponent component, LTexture[] buttonImage) { if (Touch.IsUp()) { FreeClick(); } g.BeginBatch(BlendState.NonPremultiplied); g.DrawBatch(back, x, y, backWidth, backHeight); if (isClick) { if (angle < 360) { angle += 1; } else { angle = 1; } g.DrawBatch(dot, x + centerX , y + centerY , dotWidth, dotHeight, angle); } g.DrawBatch(fore, (x + (backWidth - baseWidth) * 0.5f), (y + (backHeight - baseHeight) * 0.5f), baseWidth, baseHeight); g.EndBatch(); }
public virtual void Draw(GLEx g) { if (exist) { snow.Draw(x, y); } }
public virtual void Draw(GLEx g) { if (exist) { sakura.Draw(x, y); } }
public virtual void CreateUI(GLEx g) { if (!visible) { return; } if (style < 2) { if (alpha > 0.1d && alpha < 1.0d) { g.SetAlpha(alpha); wait.Draw(g, X(), Y()); g.SetAlpha(1.0F); } else { wait.Draw(g, X(), Y()); } } else { if (cycle != null) { cycle.CreateUI(g); } } }
public void Draw(GLEx g, float x, float y, float w, float h) { if (isClose) { return; } lock (buffer) { g.DrawTexture(buffer.Texture, x, y, w, h); } }
public override void DrawScreen(GLEx g) { switch (type) { case 1: g.SetAntiAlias(true); g.DrawSixStart(LColor.yellow, 130, 100, 100); g.SetAntiAlias(false); break; } g.ResetColor(); }
public override void CreateUI(GLEx g, int x, int y, LComponent component, LTexture[] buttonImage) { if (visible && goalPath != null) { g.SetLineWidth(lineWidth); g.GLBegin(GL.GL_LINE_STRIP); g.Draw(goalPath, color); g.GLEnd(); g.ResetLineWidth(); g.ResetColor(); } }
public void Draw(GLEx g, int x, int y, int sx, int sy, LColor color) { if (target.IsBatch()) { float nx = sx * tw; float ny = sy * th; target.Draw(x, y, tw, th, nx, ny, nx + tw, ny + th, color); } else { CheckImage(sx, sy); g.DrawTexture(subImages[sx][sy], x, y); } }
public virtual void CreateUI(GLEx g) { if (visible) { if (alpha > 0 && alpha < 1) { g.SetAlpha(alpha); } g.DrawTexture(image, X(), Y()); if (alpha > 0 && alpha < 1) { g.SetAlpha(1.0f); } } }
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(); } }
public void CreateUI(GLEx g) { if (!visible) { return; } if (stop) { return; } float op = (currentFrame / time); SetOpacity(op); if (opacity > 0) { byte a = (byte)(this.opacity * 255); g.FillRect(offsetX + this.X(), offsetY + this.Y(), width, height, new Color(color.R, color.G, color.B, a)); return; } }
public void CreateUI(GLEx g) { if (!visible) { return; } if (!complete) { if (alpha > 0 && alpha < 1) { g.SetAlpha(alpha); } g.DrawTexture(texture, X(), Y()); if (alpha > 0 && alpha < 1) { g.SetAlpha(1); } } }
public virtual void CreateUI(GLEx g) { if (!visible) { return; } if (alpha > 0 && alpha < 1) { g.SetAlpha(alpha); } for (int i = 0; i < drops.Length; ++i) { g.FillOval((int)drops[i].x, (int)drops[i].y, 2, 2, color.Color); } if (alpha > 0 && alpha < 1) { g.SetAlpha(1); } }
public void CreateUI(GLEx g) { if (!visible) { return; } if (complete) { return; } if (alpha > 0 && alpha < 1) { g.SetAlpha(alpha); } if (count <= 1) { g.SetColor(color); g.FillRect(X(), Y(), width, height); g.ResetColor(); } else { g.SetColor(color); int length = (int)MathUtils.Sqrt(MathUtils.Pow(width / 2, 2.0f) + MathUtils.Pow(height / 2, 2.0f)); float x = X() + (width / 2 - length); float y = Y() + (height / 2 - length); float w = width / 2 + length - x; float h = height / 2 + length - y; float deg = 360f / this.div * this.count; g.FillArc(x, y, w, h, 0, this.sign[this.turn] * deg); g.ResetColor(); } if (alpha > 0 && alpha < 1) { g.SetAlpha(1f); } }
public override void CreateUI(GLEx g) { base.CreateUI(g); switch (type) { case 0: if (a1 == null) { a1 = Animation.GetDefaultAnimation("assets/s.png", 3, 48, 48, 100); } animation = a1; break; case 2: if (a2 == null) { a2 = Animation .GetDefaultAnimation("assets/s1.png", 48, 48, 100); } animation = a2; break; default: break; } if (animation == null) { return; } if (type == 0 || type == 2) { LTexture img = animation.GetSpriteImage(); if (img != null) { g.DrawTexture(img, X() + (GetWidth() - img.GetWidth()) / 2, Y() + (GetHeight() - img.GetHeight()) / 2); } } }
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 void CreateUI(GLEx g) { if (!visible) { return; } int size = barCaches.Count; if (size > 0) { lock (barCaches) { StatusBar.GLBegin(); for (int i = 0; i < size; i++) { StatusBar bar = barCaches[i]; if (bar != null && bar.visible) { bar.CreateUI(g); } } StatusBar.GLEnd(); } } }
public void Load(GraphicsDevice d) { this.gl = new GLEx(d); }
public override void Step(GLEx g, float x, float y, float progress, int index, int frame_0, LColor color_1, float alpha_2) { float cx = this.padding + 50, cy = this.padding + 50, angle = (MathUtils.PI / 180) * (progress * 360), innerRadius = (index == 1) ? 10 : 25; if (path == null) { path = new Path(GetX() + x * scale, GetY() + y * scale); } else { path.Clear(); path.Set(GetX() + x * scale, GetY() + y * scale); } path.LineTo(GetX() + ((MathUtils.Cos(angle) * innerRadius) + cx) * scale, GetY() + ((MathUtils.Sin(angle) * innerRadius) + cy) * scale); path.Close(); g.Draw(path); }
public override void Step(GLEx g, float x, float y, float progress, int index, int frame_0, LColor color_1, float alpha_2) { float cx = this.padding + 50, cy = this.padding + 50, angle = (MathUtils.PI / 180) * (progress * 360); alpha_2 = MathUtils.Max(0.5f, alpha_2); g.SetAlpha(alpha_2); if (path == null) { path = new Path(GetX() + x * scale, GetY() + y * scale); } else { path.Clear(); path.Set(GetX() + x * scale, GetY() + y * scale); } path.LineTo(GetX() + ((MathUtils.Cos(angle) * 35) + cx) * scale, GetY() + ((MathUtils.Sin(angle) * 35) + cy) * scale); path.Close(); g.Draw(path); if (path == null) { path = new Path(GetX() + ((MathUtils.Cos(-angle) * 32) + cx) * scale, GetY() + ((MathUtils.Sin(-angle) * 32) + cy) * scale); } else { path.Clear(); path.Set(GetX() + ((MathUtils.Cos(-angle) * 32) + cx) * scale, GetY() + ((MathUtils.Sin(-angle) * 32) + cy) * scale); } path.LineTo(GetX() + ((MathUtils.Cos(-angle) * 27) + cx) * scale, GetY() + ((MathUtils.Sin(-angle) * 27) + cy) * scale); path.Close(); g.Draw(path); g.SetAlpha(1); }
private void Step(GLEx g, CycleProgress e, int index, int frame_0, LColor color_1, float alpha_2) { switch (stepType) { case 0: g.FillOval(X() + e.x - blockHalfWidth, Y() + e.y - blockHalfHeight, blockWidth, blockHeight); break; case 1: g.FillRect(X() + e.x - blockHalfWidth, Y() + e.y - blockHalfHeight, blockWidth, blockHeight); break; case 2: if (last != null) { float[] xs = { X() + last.x, X() + e.x }; float[] ys = { Y() + last.y, Y() + e.y }; g.DrawPolygon(xs, ys, 2); } last = e; break; case 3: if (last != null) { g.DrawLine(X() + last.x, Y() + last.y, X() + e.x, Y() + e.y); } last = e; break; case 4: Step(g, e.x, e.y, e.progress, index, frame_0, color_1, alpha_2); break; } }
public virtual void Step(GLEx g, float x_0, float y_1, float progress_2, int index, int frame_3, LColor color_4, float alpha_5) { }
public virtual void CreateUI(GLEx g) { if (!isVisible) { return; } this.Setup(); int pointsLength = points.Count; CycleProgress point; int index; int frameD; int indexD; float size = (pointsLength * this.trailLength); for (float i = -1, l = size; ++i < l && !this.stopped; ) { index = (int)(frame + i); if (index < pointsLength) { point = points[index]; } else { point = points[index - pointsLength]; } this.alpha = (i / (l - 1)); frameD = frame / (pointsLength - 1); indexD = (int)alpha; if (lineWidth > 0) { g.SetLineWidth(lineWidth); } if (scaleX != 1 || scaleY != 1) { g.Scale(scaleX, scaleY); } if (alpha > 0 && alpha < 1) { g.SetAlpha(alpha); } g.SetColor(color); Step(g, point, indexD, frameD, color, alpha); g.ResetColor(); if (alpha > 0 && alpha < 1) { g.SetAlpha(1); } if (lineWidth > 0) { g.ResetLineWidth(); } if (scaleX != 1 || scaleY != 1) { g.Restore(); } } }
// ���� public void Draw(GLEx g) { if (!visible) { return; } alpha = startTime / 255f; g.SetAlpha(alpha); g.DrawTexture(texture, info.offsetX + x, info.offsetY + y , width, height); g.SetAlpha(1f); }
protected override void CreateCustomUI(GLEx g, int x, int y, int w, int h) { if (!visible) { return; } if (message.Length != 0) { DrawMessage(g); } flag.Draw(g); }
public override void CreateUI(GLEx g, int x, int y, LComponent component, LTexture[] buttonImage) { }
public override void Draw(GLEx g) { }
private void DrawMessage(GLEx g) { if (batch == null) { return; } lock (batch) { char[] chars = message.ToCharArray(); int len = message.Length; int i, j = 0; char ch; batch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, null, null, GLEx.Device.RasterizerState, null, GLEx.cemera.viewMatrix); if (isHch) { for (i = 0; i < len; i++) { ch = chars[i]; if (ch != '\n') { batch.DrawString(deffont.Font, "" + ch, new Vector2(offsetY + message_y[j], offsetX + message_x[j]), fontColor.Color); j++; } } } else { for (i = 0; i < len; i++) { ch = chars[i]; if (ch != '\n') { batch.DrawString(deffont.Font, "" + ch, new Vector2(offsetX + message_x[j], offsetY + message_y[j]), fontColor.Color); j++; } } } batch.End(); } }
public void Draw(GLEx gl, long elapsed) { if (logo == null || finish) { return; } if (!logo.isLoaded) { this.logo.LoadTexture(); this.centerX = (int)(LSystem.screenRect.width * LSystem.scaleWidth) / 2 - logo.Width / 2; this.centerY = (int)(LSystem.screenRect.height * LSystem.scaleHeight) / 2 - logo.Height / 2; } if (logo == null || !logo.isLoaded) { finish = true; return; } lock (logo) { gl.Clear(); color.A = (byte)(255 * alpha); gl.DrawTexture(logo, centerX, centerY, color); } switch (type) { case 0: if (alpha >= 1f) { alpha = 1f; type = 1; } if (alpha < 1.0f) { if (timer.Action(elapsed)) { alpha += 0.015f; } } break; case 1: if (timer.Action(elapsed)) { alpha = 1f; type = 2; } break; case 2: if (alpha > 0.0f) { if (timer.Action(elapsed)) { alpha -= 0.015f; } } else if (alpha <= 0f) { alpha = 0; type = 3; finish = true; if (logo != null) { logo.Destroy(); logo = null; } return; } break; } }