/// <summary> /// Update /// </summary> protected override void Update(GameTime gameTime) { // Update game engine base.Update(gameTime); var controller = XboxController.RetrieveController(0); controller.UpdateState(); if (controller.IsBackPressed || Keyboard.GetState().IsKeyDown(Keys.Escape)) { Exit(); } var elapsedGameTime = (float)gameTime.ElapsedGameTime.TotalSeconds; var input = new PlayerInput(); HandleInput(ref input, controller); game.Input(input); game.Update(elapsedGameTime); frame = game.getPosition(); CameraPos = new Vector3(frame.Position.X, -frame.Position.Y, CameraPos.Z); ViewMatrix = Matrix.CreateLookAt(CameraPos, new Vector3(CameraPos.X, CameraPos.Y, 0), Vector3.Up); Window.Title = "GTA2.NET - " + WindowTitle + Fps.ToString(CultureInfo.InvariantCulture) + " fps X: " + CameraPos.X.ToString() + "Y: " + CameraPos.Y.ToString() + "Z: " + CameraPos.Z; }
protected override void OnRender(DrawingContext context) { base.OnRender(context); context.DrawLine(baselinePen, angleLeftLeft, angleLeftRight); //context.DrawText(warningFormattedText, new Point(ActualWidth/2, ActualHeight/2)); context.DrawLine(baselinePen, angleRightLeft, angleRightRight); context.DrawLine(baselinePen, directionLineLeftBoundTop, directionLineLeftBoundBottom); context.DrawLine(baselinePen, directionLineRightBoundTop, directionLineRightBoundBottom); context.DrawLine(baselinePen, directionTop, directionBottom); RenderGauge(context, Humidity.ToString("0.00"), 2, humidityFormattedText); RenderGauge(context, Temperature.ToString("0.00"), 6, temperatureFormattedText); RenderGauge(context, Fps.ToString("0.0"), 18, fpsFormattedText); RenderGauge(context, Voltage.ToString("0.00"), 4, voltageFormattedText); RenderGauge(context, Current.ToString("0.00"), 16, currentFormattedText); RenderGauge(context, Thrust.ToString("0"), 10, thrustFormattedText); RenderGauge(context, Salinity.ToString("0.00"), 8, salinityFormattedText); RenderGauge(context, Depth.ToString("0.00"), 12, depthFormattedText); RenderGauge(context, ExtTemp.ToString("0.00"), 14, extTempFormattedText); RenderDepthGauge(context); RenderBatteryBar(context); if (ScreenshotAck == true) { RenderCTDValues(context, "Captured!", 2, screenshotFormattedText); } RenderCompass(context); RenderFalseHorizon(context); //RenderMap(context); //RenderLocation(context); }
void OnCompletePrepare(VideoPlayer videoPlayer) { videoPlayer.Play(); var information = currentFps.ToString(); informationText.Show(information, movieInformationVisibleDuration); }
//----------------------------------------------------------------------------------------------- // //----------------------------------------------------------------------------------------------- protected override void Draw(GameTime gameTime) { UpdateFrame(); _visualTree.AdvanceAnimations(gameTime); base.Draw(gameTime); //Debug.WriteLine("AAA---------------------- BEGIN ------------------------"); //Debug.WriteLine("AAA_spriteBatch.Begin();"); _spriteBatch.Begin(); GraphicsDevice.Clear(GlobalBackgroundColor); BeginClipping(DrawOffset, ScreenSize); _visualTree.Prepare(_widgetSpace.StyleLibrary); _visualTree.RenderMe(gameTime); if (ShowFps) { DrawText("Fps: " + Fps.ToString(".0"), null, .05f, DrawOffset + new Vector2(0.01f, 0.01f), Color.Black); } EndClipping(0, Vector2.Zero, new Vector2(1), false, false); if (_drawBuffers.Count > 0) { throw new ApplicationException("There was an unmatch BeginClipping call."); } //Debug.WriteLine("AAA_spriteBatch.End();"); _spriteBatch.End(); //Debug.WriteLine("AAA---------------------- END ------------------------"); }
public override void Draw(GameTime gameTime) { if (!this.Visible || Font == null) { return; } spriteBatch.Begin(); spriteBatch.DrawString(Font, Fps.ToString(), Vector2.Zero, Color.Blue); spriteBatch.End(); base.Draw(gameTime); }
//----------------------------------------------------------------------------------------------- // //----------------------------------------------------------------------------------------------- protected override void Draw(GameTime gameTime) { UpdateFrame(); _visualTree.AdvanceAnimations(gameTime); base.Draw(gameTime); _spriteBatch.Begin(); GraphicsDevice.Clear(GlobalBackgroundColor); BeginClipping(DrawOffset, ScreenSize); _visualTree.Prepare(_widgetSpace.StyleLibrary); _visualTree.UpdateFormatting(ScreenSize); if (VarmintWidget.VisualDebuggingEnabled) { _debugContext.Counter++; _debugScreen.UpdateFormatting(ScreenSize); if (_debugContentHolder.Children.Count() == 0) { _debugContentHolder.AddChild(_visualTree); } _debugScreen.RenderMe(gameTime); } else { _visualTree.RenderMe(gameTime); } if (ShowFps) { DrawText("Fps: " + Fps.ToString(".0"), null, .05f, DrawOffset + new Vector2(0.01f, 0.01f), Color.Black); } EndClipping(0, Vector2.Zero, new Vector2(1), false, false); if (_drawBuffers.Count > 0) { throw new ApplicationException("There was an unmatched BeginClipping call."); } _spriteBatch.End(); }
private void btnVideoOpen_Click(object sender, EventArgs e) { Image InitialFrame; int FramesCount; double Fps; // 1. Ввод пути к файлу с помощью стандартного диалога DialogResult dlgResult = dlgVideoOpen.ShowDialog(this); if (dlgResult != DialogResult.OK) { return; } // 2. На всякий случай закрываем текущий открытый файл btnVideoClose_Click(sender, e); // 3. Пытаемся открыть новый файл bool success = cam.Open(dlgVideoOpen.FileName, out VideoHandle, out InitialFrame, out FramesCount, out Fps); if (!success) { MessageBox.Show("Unable to open video file!", "ERROR", MessageBoxButtons.OK); return; } // 4. Инициализируем элементы управления на форме pbrVideo.Value = 0; picVideo.Image = InitialFrame; isVideoOpened = true; lblVideoFilePath.Text = dlgVideoOpen.FileName; tbxVideoCurrentFrame.Text = "0"; tbxVideoFps.Text = Fps.ToString(); tbxVideoTotalFrames.Text = FramesCount.ToString(); }
public string GetField(int field) { switch (field) { case 0: return(HostName); case 1: return(GameName); case 2: return(GameVersion); case 3: return(MapName); case 4: return(GameType); case 5: return(GameVariant); case 6: return(NumPlayers.ToString()); case 7: return(MaxPlayers.ToString()); case 8: return(GameMode); case 9: return((Password ? 1 : 0).ToString()); case 10: return(TimeLimit.ToString()); case 11: return(RoundTime.ToString()); case 12: return(HostPort.ToString()); case 13: return((Dedicated ? 1 : 0).ToString()); case 14: return((Ranked ? 1 : 0).ToString()); case 15: return((AntiCheat ? 1 : 0).ToString()); case 16: return(OS); case 17: return((BattleRecorder ? 1 : 0).ToString()); case 18: return(BRIndex); case 19: return(BRDownload); case 20: return((Voip ? 1 : 0).ToString()); case 21: return((AutoBalance ? 1 : 0).ToString()); case 22: return((FriendlyFire ? 1 : 0).ToString()); case 23: return(TKMode); case 24: return(StartDelay.ToString()); case 25: return(SpawnTime.ToString("0.000000", CultureInfo.InvariantCulture)); case 26: return(ServerText); case 27: return(ServerLogo); case 28: return(CommunityWebsite); case 29: return(ScoreLimit.ToString()); case 30: return(TicketRatio.ToString()); case 31: return(TeamRatio.ToString("0.000000", CultureInfo.InvariantCulture)); case 32: return(Team1Name); case 33: return(Team2Name); case 34: return((CoopEnabled ? 1 : 0).ToString()); case 35: return((Pure ? 1 : 0).ToString()); case 36: return(MapSize.ToString()); case 37: return((Unlocks ? 1 : 0).ToString()); case 38: return(Fps.ToString()); case 39: return((Plasma ? 1 : 0).ToString()); case 40: return(ReservedSlots.ToString()); case 41: return(CoopBotRatio.ToString()); case 42: return(CoopBotCount.ToString()); case 43: return(CoopBotDifficulty.ToString()); case 44: return((NoVehicles ? 1 : 0).ToString()); default: return(""); } }
public override string ToString() { return($"current FPS: {Fps.ToString("0.")} | average FPS over 1 second {FpsPer1Sec.ToString("0.")} | average FPS over 10 seconds {FpsPer10Sec.ToString("0.")}"); }
public override string ToString() { return(Description + " (" + Width + "x" + Height + "_" + Fps.ToString("0.##") + ")"); }
public override string ToString() { // ColorBGRA32_1080PNarrowFOV_2x2_Binned_30True0Standalone0False //ColorBGRA32 //_1080P //NarrowFOV_2x2_Binned //_30 //True //0 //Standalone //0 //False return(ColorFormat.ToString() + "\n" + ColorResolution.ToString() + "\n" + DepthMode.ToString() + "\n" + CameraFps.ToString() + "\n" + SynchronizedImagesOnly.ToString() + "\n" + DepthDelayOffColorUsec.ToString() + "\n" + WiredSyncMode.ToString() + "\n" + SubordinateDelayOffMasterUsec.ToString() + "\n" + DisableStreamingIndicator.ToString()); }
/// <summary> /// Returns a string that represents the current object. /// </summary> /// <returns>A string that represents the current object.</returns> /// <since_tizen> 3 </since_tizen> public override string ToString() { return($"Size=({ Size.ToString() }), Fps={ Fps.ToString() }, BitRate={ BitRate.ToString() }"); }
/// <summary> /// Returns a string that represents the current object. /// </summary> /// <returns>A string that represents the current object.</returns> /// <since_tizen> 3 </since_tizen> public override string ToString() { return($"Fps={ Fps.ToString() }, BitRate={ BitRate.ToString() }, Size=[{ Size.ToString() }]"); }