public MainForm() { InitializeComponent(); resDispl = new DrawingSurface(); resDispl.Target.SetActive(false); resSprite = new DynamicSprite(); var tmp = new DrawingSurface(); tmp.Dock = DockStyle.Fill; Program.Display = tmp.Target; DisplayPanel.Controls.Add(tmp); Program.Display.Resized += (sender, e) => { SFML.Graphics.View view = new SFML.Graphics.View(new Vector2f(), new Vector2f(e.Width, e.Height)); Program.Display.SetView(view); }; tmp = new DrawingSurface(); Displayer = tmp; tmp.Dock = DockStyle.Fill; Program.Timeline = tmp.Target; TimelinePanel.Controls.Add(tmp); Program.Timeline.Resized += (sender, e) => { SFML.Graphics.View view = new SFML.Graphics.View(new FloatRect(0, 0, e.Width, e.Height)); Program.Timeline.SetView(view); Program.ResizeTimeline(); }; }
public ResourceStep12(Resource res, Vector2i s, int frames) { fpsCount = frames; size = s; numberOfImages = res.FramesPosition.Length; Finished = false; InitializeComponent(); Dock = DockStyle.Fill; toAddTexture = new Texture((SFML.Graphics.Image)Properties.Resources.toAdd) { Smooth = true }; noAddTexture = new Texture((SFML.Graphics.Image)Properties.Resources.noAdd) { Smooth = true }; hint = new RectangleShape(); img = new Texture(res.BaseImage) { Smooth = true }; img.GenerateMipmap(); SizeX.Value = (decimal)size.X; SizeY.Value = (decimal)size.Y; fps.Value = (decimal)fpsCount; { int x = 0, y = 0; int positions = 0; if (size.X > 0 && size.Y > 0) { do { x = 0; do { positions++; x += size.X; } while (x + size.X <= img.Size.X); y += size.Y; } while (y + size.Y <= img.Size.Y); } nbImages.Maximum = (decimal)positions; } nbImages.Value = (decimal)numberOfImages; var thread = new System.Threading.Thread(UpdateDisp); Disp = new DrawingSurface(); Disp.Dock = DockStyle.Fill; dispPanel.Controls.Add(Disp); Disp.Target.SetActive(false); thread.Start(); }
public FunctionDialog() { InitializeComponent(); Function = Animation.Key.Fct.LINEAR; var tmp = new DrawingSurface(); tmp.Dock = DockStyle.Fill; App = tmp.Target; preview.Controls.Add(tmp); App.Resized += (sender, e) => { App.SetView(new SFML.Graphics.View(new FloatRect(0, 0, e.Width, e.Height))); }; App.SetFramerateLimit(10); }
public ResourceStep2(Resource res, Vector2i p, Vector2i s) { pos = p; size = s; Finished = false; InitializeComponent(); Dock = DockStyle.Fill; img = new Texture(res.BaseImage); PosX.Value = (decimal)pos.X; PosY.Value = (decimal)pos.Y; SizeX.Value = (decimal)size.X; SizeY.Value = (decimal)size.Y; var thread = new System.Threading.Thread(UpdateDisp); Disp = new DrawingSurface(); Disp.Dock = DockStyle.Fill; dispPanel.Controls.Add(Disp); Disp.Target.SetActive(false); thread.Start(); }