public void Draw(FPCanvas canvas) { playerTexture.Draw(new PointF(X, Y), Rotation); }
private void DrawHandlesOnGameObject(FPCanvas canvas, FPGameObject gameObject) { RectangleF rect = gameObject.Rect; canvas.DisableTexturing(); canvas.SetCurrentColor(Color.FromArgb(204, Color.White)); canvas.DrawRectangle(rect); canvas.SetPointSize(6.0f); var draggedObject = DraggedObject; bool widthHandles = false; bool heightHandles = false; if (draggedObject != null) { widthHandles = draggedObject.WidthSegments > 0; heightHandles = draggedObject.HeightSegments > 0; } for (FPDragHandle handle = FPDragHandle.TopLeft; handle < FPDragHandle.Center; handle++) { if (!widthHandles && IsWidthHandle(handle)) continue; if (!heightHandles && IsHeightHandle(handle)) continue; if (handle == currentHandle) canvas.SetCurrentColor(Color.FromArgb(204, Color.Red)); else canvas.SetCurrentColor(Color.FromArgb(204, Color.Yellow)); PointF handlePoint = PointFromHandleAroundRect(handle, rect); canvas.DrawPoint(handlePoint); } }
public static void InitTextures(FPCanvas canvas) { playerTexture = canvas.CreateTexture(Resources.ball); jumpTexture = canvas.CreateTexture(Resources.speed); }
public void Draw(FPCanvas canvas) { canvas.SetCurrentColor(Color.White); canvas.DisableBlend(); PointF offset = new PointF(FPMath.fmodf(backgroundOffset.X, 32.0f) - 32.0f, FPMath.fmodf(backgroundOffset.Y, 32.0f) - 32.0f); backgroundTexture.Draw(offset, (int)(Width / backgroundTexture.Width) + 3, (int)(Height / backgroundTexture.Height) + 2); foreach (var gameObject in gameObjects) { if (!gameObject.IsVisible) continue; if (!gameObject.IsTransparent) gameObject.Draw(canvas); } canvas.EnableBlend(); foreach (var gameObject in gameObjects) { if (!gameObject.IsVisible) continue; if (gameObject.IsTransparent) gameObject.Draw(canvas); } player.Draw(canvas); player.DrawSpeedUp(canvas); canvas.SetCurrentColor(Color.FromArgb(204, Color.White)); fontTexture.DrawText(string.Format("Diamonds: {0}/{1}", diamondsPicked, diamondsCount), new PointF(3.0f, 0.0f), 16, 16, 32, 13); string speedUpText = null; if (player.SpeedUpCounter > 0) speedUpText = string.Format(CultureInfo.InvariantCulture, "{0:f1}", (FPPlayer.maxSpeedUpCount - player.SpeedUpCounter) / 60.0f); if (!string.IsNullOrEmpty(speedUpText)) { canvas.SetCurrentColor(Color.FromArgb(204, 127, 255, 255)); fontTexture.DrawText(speedUpText, new PointF(430.0f, 285.0f), 16, 16, 32, 13); } }
public void Draw(FPCanvas canvas) { elevatorTextures[textureIndex].Draw(new PointF(X, Y), WidthSegments, 1); }
public void Draw(FPCanvas canvas) { magnetTexture.Draw(new PointF(X, Y), WidthSegments, 1); }
public void Draw(FPCanvas canvas) { speedPowerUpTexture.Draw(new PointF(X, Y)); }
public void AddTexture(FPCanvas canvas, Bitmap bitmap) { textures.Add(canvas.CreateTexture(bitmap)); }
public static void InitTextures(FPCanvas canvas) { diamondTexture = canvas.CreateTexture(Resources.diamond); }
public void Draw(FPCanvas canvas) { FPTexture texture = trampolineTextures[textureIndex]; texture.Draw(new PointF(X, Y), WidthSegments, 1); }
public static void InitTextures(FPCanvas canvas) { trampolineTextures = new FPTextureArray(); trampolineTextures.AddTexture(canvas, Resources.trampoline01); trampolineTextures.AddTexture(canvas, Resources.trampoline02); trampolineTextures.AddTexture(canvas, Resources.trampoline03); }
public void Draw(FPCanvas canvas) { platformTexture.Draw(new PointF(X, Y), WidthSegments, HeightSegments); }
public static void InitTextures(FPCanvas canvas) { platformTexture = canvas.CreateTexture(Resources.plos_marble); }
private void InitAllTextures(FPCanvas canvas) { FPGame.InitTexture(canvas); FPPlayer.InitTextures(canvas); FPPlatform.InitTextures(canvas); FPDiamond.InitTextures(canvas); FPElevator.InitTextures(canvas); FPMovablePlatform.InitTextures(canvas); FPMagnet.InitTextures(canvas); FPSpeedPowerUp.InitTextures(canvas); FPTrampoline.InitTextures(canvas); FPExit.InitTextures(canvas); }
public void DrawSpeedUp(FPCanvas canvas) { if (SpeedUpCounter <= 0) return; float value = Math.Abs(FPMath.sinf(Alpha)) * 0.5f + 0.5f; canvas.SetCurrentColor(Color.FromArgb((int)(255 * value), Color.White)); PointF position = new PointF(X - 16.0f, Y - 16.0f); jumpTexture.Draw(position); }
public void Draw(FPCanvas canvas) { diamondTexture.Draw(new PointF(X, Y)); }
public static void InitTextures(FPCanvas canvas) { magnetTexture = canvas.CreateTexture(Resources.magnet); }
public void Draw(FPCanvas canvas) { movableTexture.Draw(new PointF(X, Y), WidthSegments, HeightSegments); }
public static void InitTextures(FPCanvas canvas) { speedPowerUpTexture = canvas.CreateTexture(Resources.speed_symbol); }
public static void InitTextures(FPCanvas canvas) { movableTexture = canvas.CreateTexture(Resources.movable); }
public static void InitTexture(FPCanvas canvas) { backgroundTexture = canvas.CreateTexture(Resources.marbleblue); fontTexture = canvas.CreateTexture(Resources.AndaleMono, true); }
public static void InitTextures(FPCanvas canvas) { exitTexture = canvas.CreateTexture(Resources.exit); }
public static void InitTextures(FPCanvas canvas) { elevatorTextures = new FPTextureArray(); elevatorTextures.AddTexture(canvas, Resources.vytah01); elevatorTextures.AddTexture(canvas, Resources.vytah02); elevatorTextures.AddTexture(canvas, Resources.vytah03); }
public void Draw(FPCanvas canvas) { exitTexture.Draw(new PointF(X, Y)); }
public void Draw(FPCanvas canvas) { canvas.SetCurrentColor(Color.FromArgb(100, Color.White)); FPElevator.ElevatorTexture.Draw(new PointF(X, Y), WidthSegments, 1); canvas.DisableTexturing(); RectangleF start = elevatorStart.Rect; RectangleF end = this.Rect; canvas.SetCurrentColor(Color.FromArgb(255, 0, 255, 0)); canvas.DrawLine(start.MiddlePoint(), end.MiddlePoint()); }
void DrawGrid(FPCanvas canvas) { Rectangle rect = levelView.ClientRectangle; rect.Offset(-(int)levelView.ViewOffset.X, -(int)levelView.ViewOffset.Y); rect.X /= 32; rect.Y /= 32; rect.X *= 32; rect.Y *= 32; canvas.SetCurrentColor(Color.FromArgb((int)(0.2 * 255), Color.White)); for (int y = rect.Top; y < rect.Bottom + 32; y += 32) canvas.DrawLine(new Point(rect.Left, y), new Point(rect.Right + 32, y)); for (int x = rect.Left; x < rect.Right + 32; x += 32) canvas.DrawLine(new Point(x, rect.Top), new Point(x, rect.Bottom + 32)); }