コード例 #1
0
ファイル: GrabOperator.cs プロジェクト: JacquesLucke/Collage
        public void SetData(DataAccess dataAccess, CollageEditData editData)
        {
            this.dataAccess = dataAccess;
            this.editData = editData;

            lastMouseDownPosition = dataAccess.Input.MousePositionVector;
        }
コード例 #2
0
        public CollageEditState(DataAccess dataAccess)
        {
            this.dataAccess = dataAccess;

            // create CollageEditData. Inside you find all the information about the collage and how it is drawn
            CollageObject collage = new CollageObject();
            int width = dataAccess.GraphicsDevice.Viewport.Bounds.Width - 100;
            int height = (int)Math.Round(width / collage.AspectRatio);
            MoveableRectangle drawRectangle = new MoveableRectangle(new FloatRectangle(50, 50, width, height));
            UndoManager undoManager = new UndoManager();

            editData = new CollageEditData(collage, drawRectangle, undoManager);

            // create the Preview Renderer
            previewRenderer = new CollagePreviewRenderer(dataAccess);
            previewRenderer.SetEditData(editData);

            RegisterCollageOperators();

            // create activators
            activators = new List<IOperatorActivator>();
            activators.Add(new SpecialOperatorActivator(dataAccess, collageOperators));
            activators.Add(new KeymapActivator(dataAccess, collageOperators));
            activators.Add(new ToolbarActivator(dataAccess, collageOperators));
        }
コード例 #3
0
        public void SetData(DataAccess dataAccess, CollageEditData editData)
        {
            this.dataAccess = dataAccess;
            this.editData = editData;

            font = dataAccess.Content.GetSpriteFont("normal font");
            emptyTexture = dataAccess.Content.GetImageSource("empty").Texture;
        }
コード例 #4
0
        public void SetData(DataAccess dataAccess, CollageEditData editData)
        {
            this.dataAccess = dataAccess;
            this.editData = editData;

            okButton = new TexturedButton(dataAccess, dataAccess.Content.GetImageSource("check icon"));
            cancelButton = new TexturedButton(dataAccess, dataAccess.Content.GetImageSource("delete icon"));
            rightMoveButton = new TexturedButton(dataAccess, dataAccess.Content.GetImageSource("right icon"));
            downMoveButton = new TexturedButton(dataAccess, dataAccess.Content.GetImageSource("down icon"));
        }
コード例 #5
0
        public void SetData(DataAccess dataAccess, CollageEditData editData)
        {
            this.dataAccess = dataAccess;
            this.editData = editData;

            tex = new Texture2D(dataAccess.GraphicsDevice, 1, 1);
            tex.SetData<Color>(new Color[] { Color.White });

            imageEffect = dataAccess.Content.GetEffect("image effect");
            dropShadowEffect = dataAccess.Content.GetEffect("drop shadow effect");
        }
コード例 #6
0
 public void SetEditData(CollageEditData editData)
 {
     this.editData = editData;
 }
コード例 #7
0
 public void SetData(DataAccess dataAccess, CollageEditData editData)
 {
     this.dataAccess = dataAccess;
     this.editData = editData;
 }