void MouseObjectControl() { SECursor cursor = GameData.Cursor; if (cursor.WindowOver == null && GuiManager.DominantWindowActive == false && cursor.IsInWindow()) { if (GuiData.ToolsWindow.attachSprite.IsPressed == false) { mAxes.Control(cursor, GameData.Camera, xToY); } cursor.Activity(); if (SpriteEditorSettings.EditingSprites) { foreach (EditorSprite sprite in mCurrentSprites) { testGridSnappingMove(sprite); } } } }
public GameForm() : base() { this.DragEnter += new System.Windows.Forms.DragEventHandler(this.GameForm_DragDrop); this.Text = "SpriteEditor - untitled scene"; camera = new SpriteEditor.SEPositionedObjects.EditorCamera(FlatRedBallServices.GlobalContentManager); SpriteManager.Cameras[0] = camera; camera.DestinationRectangle = new Rectangle(0, 0, FlatRedBallServices.ClientWidth, FlatRedBallServices.ClientHeight); camera.FixAspectRatioYConstant(); if (this.IsDisposed) { return; } // this is a little different than what is normally done in the FRBTemplate; // instead of using the SpriteManager's regularly created Camera, make a new // EditorCamera and throw that in the SpriteManager's array. cursor = new SECursor(camera, this); //GuiManager.Initialize(camera, "genGfx/defaultText.tga", this, cursor); GuiManager.Cursors[0] = cursor; FlatRedBallServices.Update(null); SpriteEditorSettings.Initialize(); SpriteManager.MaxParticleCount = 10000; GameData.Initialize(); GuiData.Initialize(); GuiData.messages.Initialize(this); }
public GameForm() : base() { this.DragEnter += new System.Windows.Forms.DragEventHandler(this.GameForm_DragDrop); this.Text = "SpriteEditor - untitled scene"; camera = new SpriteEditor.SEPositionedObjects.EditorCamera(FlatRedBallServices.GlobalContentManager); SpriteManager.Cameras[0] = camera; camera.DestinationRectangle = new Rectangle(0, 0, FlatRedBallServices.ClientWidth, FlatRedBallServices.ClientHeight); camera.FixAspectRatioYConstant(); if(this.IsDisposed) return; // this is a little different than what is normally done in the FRBTemplate; // instead of using the SpriteManager's regularly created Camera, make a new // EditorCamera and throw that in the SpriteManager's array. cursor = new SECursor(camera, this); //GuiManager.Initialize(camera, "genGfx/defaultText.tga", this, cursor); GuiManager.Cursors[0] = cursor; FlatRedBallServices.Update(null); SpriteEditorSettings.Initialize(); SpriteManager.MaxParticleCount = 10000; GameData.Initialize(); GuiData.Initialize(); GuiData.messages.Initialize(this); }
private void UpdateObjectOverMarker() { SECursor cursor = GameData.Cursor; float polygonScaleX = (float)mObjectOverMarker.Points[0].X; float polygonScaleY = (float)mObjectOverMarker.Points[0].Y; mModelOverHighlight.Visible = false; if (cursor.SpritesOver.Count != 0) { mObjectOverMarker.Visible = true; mObjectOverMarker.Position = cursor.SpritesOver[0].Position; mObjectOverMarker.RotationMatrix = cursor.SpritesOver[0].RotationMatrix; mObjectOverMarker.ScaleBy(cursor.SpritesOver[0].ScaleX / polygonScaleX, cursor.SpritesOver[0].ScaleY / polygonScaleY); } else if (cursor.SpriteFramesOver.Count != 0) { mObjectOverMarker.Visible = true; mObjectOverMarker.Position = cursor.SpriteFramesOver[0].Position; mObjectOverMarker.RotationMatrix = cursor.SpriteFramesOver[0].RotationMatrix; mObjectOverMarker.ScaleBy(cursor.SpriteFramesOver[0].ScaleX / polygonScaleX, cursor.SpriteFramesOver[0].ScaleY / polygonScaleY); } else if (cursor.PositionedModelsOver.Count != 0) { PositionedModel modelOver = cursor.PositionedModelsOver[0]; mModelOverHighlight.Visible = true; mModelOverHighlight.SetDataFrom(modelOver); mModelOverHighlight.Position = modelOver.Position; mModelOverHighlight.RotationMatrix = modelOver.RotationMatrix; mModelOverHighlight.ScaleX = modelOver.ScaleX; mModelOverHighlight.ScaleY = modelOver.ScaleY; mModelOverHighlight.ScaleZ = modelOver.ScaleZ; } else if (cursor.TextsOver.Count != 0) { mObjectOverMarker.Visible = true; mObjectOverMarker.Position = cursor.TextsOver[0].Position; mObjectOverMarker.Position.X = cursor.TextsOver[0].HorizontalCenter; mObjectOverMarker.Position.Y = cursor.TextsOver[0].VerticalCenter; mObjectOverMarker.RotationMatrix = cursor.TextsOver[0].RotationMatrix; mObjectOverMarker.ScaleBy(cursor.TextsOver[0].ScaleX / polygonScaleX, cursor.TextsOver[0].ScaleY / polygonScaleY); } else { mObjectOverMarker.Visible = false; } }
public static void Initialize() { #region FRB engine managers and data Camera = GameForm.camera; GameForm.camera.Name = "Main View Camera"; Cursor = GameForm.cursor; #endregion mWorldAxesDisplay = new WorldAxesDisplay(); SpriteManager.Camera.BackgroundColor = System.Drawing.Color.Gray; try { if (System.IO.File.Exists("settings/guiSettings.txt")) { GuiManager.LoadSettingsFromText("settings/guiSettings.txt"); } } catch { // no big deal, just ignore it } tempTargetBoxLayer = SpriteManager.AddLayer(); BoundsCamera = new Camera(FlatRedBallServices.GlobalContentManager); BoundsCamera.Z = -40; BoundsCamera.FieldOfView = (float)System.Math.PI / 4.0f; BoundsCamera.AspectRatio = 4.0f / 3.0f; BoundsCamera.OrthogonalWidth = 800; BoundsCamera.OrthogonalHeight = 600; BoundsCamera.Name = "Bounds Camera"; EditorProperties = new EditorProperties(); sesgMan = new SESpriteGridManager(); sfMan = new SpriteFrameManager(); Camera.FarClipPlane = 3900; Cursor.Initialize(); ModelManager.ModelLightSetup = ModelManager.LightSetup.FullAmbient; }