public RendererParams( Camera camera, UserActionInEditor userActionInEditor, Rectangle selectionRectangle, EntityCreation entityCreation, SnapPoint snapPoint ) { Camera = camera ; UserActionInEditor = userActionInEditor ; SelectionRectangle = selectionRectangle ; EntityCreation = entityCreation ; SnapPoint = snapPoint ; ItemsToRender=ItemsToRender.Everything; }
public RendererParams(Camera camera, UserActionInEditor userActionInEditor, Rectangle selectionRectangle, EntityCreation entityCreation, SnapPoint snapPoint) { Camera = camera; UserActionInEditor = userActionInEditor; SelectionRectangle = selectionRectangle; EntityCreation = entityCreation; SnapPoint = snapPoint; ItemsToRender = ItemsToRender.Everything; }
public void WhenEnteringEditor( ICanvas canvas, DraggingContext context) { _temporaryEntityOnCanvas = canvas.StartCreatingEntityNow(_entityCreationProperties); }
void drawCurrentItemBeingCreatedIfNeeded(UserActionInEditor userActionInEditor, EntityCreation entityCreation) { if (userActionInEditor == UserActionInEditor.AddingAnItem && entityCreation.StartedCreating) { entityCreation.CurrentEditor.DrawInEditor(_game.SpriteBatch); } }
void drawCurrentItemBeingCreatedIfNeeded( UserActionInEditor userActionInEditor, EntityCreation entityCreation ) { if( userActionInEditor == UserActionInEditor.AddingAnItem && entityCreation.StartedCreating ) { entityCreation.CurrentEditor.DrawInEditor( _game.SpriteBatch ) ; } }
public Canvas( IMainForm mainForm, IModel model ) { _inputHandlerForWhenEditorIdle = new InputHandlerForWhenEditorIdle( this ); _inputHandlerForWhenMovingOrCopyingItems = new InputHandlerForWhenMovingOrCopyingItems( this ); _inputHandlerWhenRotatingItems = new InputHandlerWhenRotatingItems( this ); _inputHandlerWhenScalingItems = new InputHandlerWhenScalingItems( this ); _inputHandlerWhenCreatingTheSelectionRectangle = new InputHandlerWhenCreatingTheSelectionRectangle( this ); _mainForm = mainForm ; _model = model ; _model.NewModelLoaded += newModelLoaded ; _entityCreation = new EntityCreation( whenEntityReadyToBeAdded: ( ) => { addTheEntityCurrentlyBeingCreated( ) ; _entityCreation.ClearCurrentEditor( ) ; _entityCreation.StartedCreating = false ; } ) ; _inputActionLookup = new Dictionary<UserActionInEditor, Action> { { UserActionInEditor.Idle, _inputHandlerForWhenEditorIdle.Update }, { UserActionInEditor.MovingItems, _inputHandlerForWhenMovingOrCopyingItems.Update }, { UserActionInEditor.CopyingItems, _inputHandlerForWhenMovingOrCopyingItems.Update }, { UserActionInEditor.RotatingItems, _inputHandlerWhenRotatingItems.Update }, { UserActionInEditor.ScalingItems, _inputHandlerWhenScalingItems.Update }, { UserActionInEditor.MovingTheCamera, handleUpdateWhenMovingTheCamera }, { UserActionInEditor.CreatingSelectionBoxByDragging, _inputHandlerWhenCreatingTheSelectionRectangle.Update }, { UserActionInEditor.AddingAnItem, handleInputWhenAddingAnEntity }, } ; _userActionInEditor = UserActionInEditor.Idle ; _positionsBeforeUserInteraction = new List<Vector2>( ) ; _rotationsBeforeUserInteraction = new List<float>( ) ; _scalesBeforeUserInteraction = new List<Vector2>( ) ; Stream stream = safeGetManifestResourceStream(@"Oglr.Resources.cursors.dragcopy.cur"); new Cursor( stream ) ; stream = safeGetManifestResourceStream(@"Oglr.Resources.cursors.rotate.cur"); _cursorRotate = new Cursor( stream ) ; stream = safeGetManifestResourceStream(@"Oglr.Resources.cursors.scale.cur"); _cursorScale = new Cursor( stream ) ; Constants.TryToLoadOtherwiseSetDefaults( @"settings.xml" ) ; }
public void WhenEnteringEditor(ICanvas canvas, DraggingContext context) { _temporaryEntityOnCanvas = canvas.StartCreatingEntityNow(_entityCreationProperties); }