public static void Initialize() { LivingMove = new LivingMoveOrderInputHandler(); LogoSkipper = new LogoSkip(); MiningAction = new MiningActionHandler(); StrafingHandler = new StrafeHandler(); EscHandler = new EscapeHandler(); ZooomHandler = new ZoomHandler(); }
private void bZoomOut_Click(object sender, RoutedEventArgs e) { cImage.Children.Clear(); ZoomHandler zh = new ZoomHandler(); zoomvalue -= 0.1f; applyChanges(zh.toZoom(files.getSelectedImage(), zoomvalue)); }
private void SpawnAnimation() //The animation which plays when the boss is spawning { rotationLocked = true; lockedRotation = 1.57f; if (checkSpecificTime(2)) { RandomizeTarget(); //pick a random target so the eyes will follow them startPos = npc.Center; if (IsInsideArena()) { StarlightPlayer mp = Main.LocalPlayer.GetModPlayer <StarlightPlayer>(); mp.ScreenMoveTarget = npc.Center + new Vector2(0, -600); mp.ScreenMoveTime = 650; } music = mod.GetSoundSlot(SoundType.Music, "Sounds/Music/VitricBossAmbient"); SetFrameX(0); SetFrameY(0); lastTwistState = 0; Helper.PlayPitched("VitricBoss/CeirosEarthquake", 0.4f, 0, npc.Center); Helper.PlayPitched("VitricBoss/CeirosRumble", 0.4f, 0, npc.Center); } if (checkSpecificTime(90)) { //Helper.PlayPitched("VitricBoss/StoneBreak", 0.25f, 0.3f, npc.Center); Helper.PlayPitched("VitricBoss/ceiroslidclose", 0.35f, 0.4f, npc.Center); } if (checkSpecificTime(120)) { if (IsInsideArena()) { StarlightPlayer mp = Main.LocalPlayer.GetModPlayer <StarlightPlayer>(); mp.Shake += 10; ZoomHandler.SetZoomAnimation(1.1f, 60); } for (int k = 0; k < 10; k++) { Gore.NewGorePerfect(arena.Center() + new Vector2(Main.rand.Next(-600, 600), -450), Vector2.UnitY * Main.rand.NextFloat(-1, 2), ModGore.GetGoreSlot(AssetDirectory.VitricBoss + "Gore/Cluster" + Main.rand.Next(1, 19))); } for (int k = 0; k < 20; k++) { Dust.NewDustPerfect(arena.Center() + new Vector2(Main.rand.Next(-600, 600), -450), DustID.Stone, Vector2.UnitY * Main.rand.NextFloat(6, 12), 0, default, Main.rand.NextFloat(1, 3));
public void Zoom_By2() { Shared.PrepareZoomImage(out Border border, out ScaleTransform scaleTranform, out TranslateTransform translateTransform); ZoomHandler zoomHandler = new ZoomHandler(border); zoomHandler.Zoom(2); Assert.Equal(2, scaleTranform.ScaleX); Assert.Equal(2, scaleTranform.ScaleY); Assert.Equal(0, translateTransform.X); Assert.Equal(0, translateTransform.Y); }
public static void Initialize() { LivingMove = new LivingMoveOrderInputHandler(); LogoSkipper = new LogoSkip(); MiningAction = new MiningActionHandler(); TillingAction = new TillingActionHandler(); StrafingHandler = new StrafeHandler(); EscHandler = new EscapeHandler(); ZooomHandler = new ZoomHandler(); ChopAction = new ChopActionHandler(); LivingMenuHandler = new LivingMenuHandler(); DragHandler = new ContainerDragHandler(); }
//private readonly FieldInfo _transformMatrix = typeof(SpriteViewMatrix).GetField("_transformationMatrix", BindingFlags.NonPublic | BindingFlags.Instance); public override void ModifyTransformMatrix(ref SpriteViewMatrix Transform) { if (false) //ignore this block { Matrix rotation = Matrix.CreateRotationZ(Rotation); Matrix translation = Matrix.CreateTranslation(new Vector3(Main.screenWidth / 2, Main.screenHeight / 2, 0)); Matrix translation2 = Matrix.CreateTranslation(new Vector3(Main.screenWidth / -2, Main.screenHeight / -2, 0)); //_transformMatrix.SetValue(Transform, ((translation2 * rotation) * translation)); //base.ModifyTransformMatrix(ref Transform); //Helper.UpdateTilt(); } Transform.Zoom = ZoomHandler.ScaleVector; ZoomHandler.UpdateZoom(); }
public static RestRequest BuildRequestAuthorization(this RestClient webClient, ZoomClientOptions options, string resource, Method method) { var request = new RestRequest(resource, method); /*var payload = new Dictionary<string, object>() * { * { "iss", options.ZoomApiKey }, * { "exp", new DateTimeOffset(DateTime.UtcNow.AddMinutes(1)).ToUnixTimeSeconds() } * }; * * webClient.Authenticator = new JwtAuthenticator(JWT.Encode(payload, Encoding.UTF8.GetBytes(options.ZoomApiSecret), JwsAlgorithm.HS256)); */ webClient.Authenticator = new JwtAuthenticator(ZoomHandler.GetToken()); request.JsonSerializer = new NewtonsoftJsonSerializer(); return(request); }
public override void OnMouseDown(ZWPictureBox pictureBox, MouseEventArgs e) { LaserAlignment laserAlignment = CtrlFactory.GetCtrlFactory().GetCtrlByType <LaserAlignment>(CtrlType.LaserAlignment); if (e.Button == MouseButtons.Left /*&& IsClickLaser(e.Location)*/ && laserAlignment.Index > -1) { count++; if (count == 1) { ZoomHandler?.Invoke(e, true); ButtonStateHandler?.Invoke(false); } else if (count == 2) { IsShowCross = true; Count = 0; ButtonStateHandler?.Invoke(true); } } }
private void bZoomIn_Click(object sender, RoutedEventArgs e) { cImage.Children.Clear(); ZoomHandler zh = new ZoomHandler(); zoomvalue += 0.1f; Image image = zh.toZoom(files.getSelectedImage(), zoomvalue); if (image.Width > width || image.Height > height) { zoomvalue -= 0.1f; } else { applyChanges(image); } applyChanges(zh.toZoom(files.getSelectedImage(), zoomvalue)); }
private void Initialize() { GPSSystem.Setup(); CityRenderHandler = new CityRenderHandler(this, CanvasMain); CustomerRenderHandler = new CustomerRenderHandler(CanvasMain, this); CarRenderHandler = new CarRenderHandler(CanvasMain, this); SimulationControlHandler = new SimulationControlHandler(this); PropertyDisplayHandler = new PropertyDisplayHandler(this); ZoomHandler = new ZoomHandler(this); DrawingLoop.Start(); ZoomLoop.Start(); WPFLoop.Subscribe(Update); CommandLoop.Subscribe(CmdUpdate); PreviewMouseWheel += ZoomHandler.Scroll; ResultImport.ResultImported += ResultImportComplete; }
public override void OnMouseDown(RichPictureBox richPictureBox, MouseEventArgs e) { LaserAlignment laserAlignment = CtrlFactory.GetCtrlFactory().GetCtrlByType <LaserAlignment>(CtrlType.LaserAlignment); if (e.Button == MouseButtons.Left /*&& IsClickLaser(e.Location)*/ && laserAlignment.Index > -1) { //count++; if (ZoomView) { if (richPictureBox.Zoom != Program.SysConfig.DefaultScaleCoefficient) { ZoomHandler?.Invoke(e, true); //ButtonStateHandler?.Invoke(false); } else { IsShowCross = true; ButtonStateHandler?.Invoke(true); PointF pointF = new PointF(e.Location.X /* / richPictureBox.Zoom*/, e.Location.Y /* / richPictureBox.Zoom*/); ClickPoint = Point.Ceiling(pointF); Coordinate.GetCoordinate().AddPoint(Index, pointF); } ZoomView = false; } else { IsShowCross = true; //ClickPoint = e.Location; Count = 0; ButtonStateHandler?.Invoke(true); //PointF pointF = new PointF(e.Location.X/* / richPictureBox.Zoom*/, e.Location.Y/* / richPictureBox.Zoom*/); PointF pointF = new PointF(e.Location.X / richPictureBox.Zoom - richPictureBox.OffsetX, e.Location.Y / richPictureBox.Zoom - richPictureBox.OffsetY); ClickPoint = Point.Ceiling(pointF); Coordinate.GetCoordinate().AddPoint(Index, pointF); //Console.WriteLine("add point: " + pointF.ToString()); } //Console.WriteLine(e.Location.ToString()); } }
/// <summary> /// Initializes a new instance of the <see cref="Viewport3DX" /> class. /// </summary> public Viewport3DX() { this.perspectiveCamera = new PerspectiveCamera(); this.orthographicCamera = new OrthographicCamera(); this.perspectiveCamera.Reset(); this.orthographicCamera.Reset(); this.Camera = this.Orthographic ? (ProjectionCamera)this.orthographicCamera : this.perspectiveCamera; //this.Children = new Element3DCollection(); this.rotateHandler = new RotateHandler(this); this.panHandler = new PanHandler(this); this.zoomHandler = new ZoomHandler(this); this.changeFieldOfViewHandler = new ZoomHandler(this, true); this.zoomRectangleHandler = new ZoomRectangleHandler(this); this.CommandBindings.Add(new CommandBinding(ViewportCommands.ZoomExtents, this.ZoomExtentsHandler)); this.CommandBindings.Add(new CommandBinding(ViewportCommands.SetTarget, this.SetTargetHandler)); this.CommandBindings.Add(new CommandBinding(ViewportCommands.Reset, this.ResetHandler)); this.CommandBindings.Add(new CommandBinding(ViewportCommands.Zoom, this.zoomHandler.Execute)); this.CommandBindings.Add(new CommandBinding(ViewportCommands.Pan, this.panHandler.Execute)); this.CommandBindings.Add(new CommandBinding(ViewportCommands.Rotate, this.rotateHandler.Execute)); this.CommandBindings.Add( new CommandBinding(ViewportCommands.ChangeFieldOfView, this.changeFieldOfViewHandler.Execute)); this.CommandBindings.Add( new CommandBinding(ViewportCommands.ZoomRectangle, this.zoomRectangleHandler.Execute)); this.CommandBindings.Add(new CommandBinding(ViewportCommands.BottomView, this.BottomViewHandler)); this.CommandBindings.Add(new CommandBinding(ViewportCommands.TopView, this.TopViewHandler)); this.CommandBindings.Add(new CommandBinding(ViewportCommands.FrontView, this.FrontViewHandler)); this.CommandBindings.Add(new CommandBinding(ViewportCommands.BackView, this.BackViewHandler)); this.CommandBindings.Add(new CommandBinding(ViewportCommands.LeftView, this.LeftViewHandler)); this.CommandBindings.Add(new CommandBinding(ViewportCommands.RightView, this.RightViewHandler)); this.SetDefaultGestures(); this.fpsWatch.Start(); this.renderingEventListener = new RenderingEventListener(this.OnCompositionTargetRendering); this.Loaded += this.ControlLoaded; this.Unloaded += this.ControlUnloaded; }
private void Zoom_Changed(object sender, SelectionChangedEventArgs e) { ZoomHandler?.ZoomBoxChanged(); }
public override bool UseItem(Player player) { player.GetModPlayer <Abilities.AbilityHandler>().InfusionLimit = 3; InfusionMaker.visible = !InfusionMaker.visible; return(true); StarlightWorld.FlipFlag(WorldFlags.VitricBossDowned); return(true); player.GetModPlayer <Abilities.AbilityHandler>().Lock <Abilities.ForbiddenWinds.Dash>(); return(true); if (ZoomHandler.ExtraZoomTarget == 0.8f) { ZoomHandler.SetZoomAnimation(0.65f); Main.NewText("Zoom: 65%"); } else if (ZoomHandler.ExtraZoomTarget == 0.65f) { ZoomHandler.SetZoomAnimation(0.5f); Main.NewText("Zoom: 50%"); } else if (ZoomHandler.ExtraZoomTarget == 0.5f) { ZoomHandler.SetZoomAnimation(1); Main.NewText("Zoom: Default"); } else { ZoomHandler.SetZoomAnimation(0.8f); Main.NewText("Zoom: 80%"); } return(true); for (int x = 0; x < Main.maxTilesX; x++) { for (int y = 0; y < Main.maxTilesY; y++) { Main.tile[x, y].ClearEverything(); } } return(true); Player dummy = new Player(); dummy.active = true; var item = new Item(); item.SetDefaults(ModContent.ItemType <UndergroundTemple.TempleRune>()); dummy.armor[5] = item; dummy.Center = Main.LocalPlayer.Center; Main.player[1] = dummy; dummy.team = Main.LocalPlayer.team; dummy.name = "Johnathan Testicle"; dummy.statLife = 400; dummy.statLifeMax = 500; return(true); /* * foreach (NPC npc in Main.npc) * npc.active = false; * * NPC.NewNPC((StarlightWorld.VitricBiome.X) * 16, (StarlightWorld.VitricBiome.Center.Y + 10) * 16, ModContent.NPCType<Bosses.GlassMiniboss.GlassweaverWaiting>()); * player.Center = new Vector2((StarlightWorld.VitricBiome.X) * 16, (StarlightWorld.VitricBiome.Center.Y + 10) * 16); * * return true;*/ }
private void bZoomOut_Click(object sender, EventArgs e) { ZoomHandler zh = new ZoomHandler(); pbPicture.Image = zh.toZoom(pbPicture.Image, 0.9f); }