Inheritance: Treefrog.Presentation.Layers.LayerPresenter
示例#1
0
        public ImportTilePool(Project project)
        {
            InitializeComponent();

            _project = project;

            _localTexturePool = new TexturePool();
            _localManager = new TilePoolManager(_localTexturePool);

            _buttonOK.Enabled = false;

            _layerControl = new LayerGraphicsControl();
            _layerControl.Dock = DockStyle.Fill;
            _layerControl.WidthSynced = true;
            _layerControl.CanvasAlignment = CanvasAlignment.UpperLeft;
            _layerControl.TextureCache.SourcePool = _localManager.TexturePool;

            _rootLayer = new GroupLayerPresenter();
            _layerControl.RootLayer = new GroupLayer(_rootLayer);

            _previewPanel.Controls.Add(_layerControl);

            _message.Text = "";

            _buttonTransColor.Click += ButtonTransColorClickHandler;
            _checkboxTransColor.Click += CheckboxTransColorClickHandler;
            _layerControl.MouseDown += PreviewControlClickHandler;
        }
示例#2
0
        public GroupLayer(GroupLayerPresenter model)
            : base(model)
        {
            _adapter = new ObservableCollectionAdapter<LayerPresenter, CanvasLayer>(layer => {
                return LayerFactory.Default.Create(layer);
            });
            _adapter.Dependent.CollectionChanged += DependentCollectionChanged;

            if (model != null)
                _adapter.Primary = model.Layers;

            _dependent = new ReadOnlyObservableCollection<CanvasLayer>(_adapter.Dependent);
        }
示例#3
0
        private void InitializeLayers()
        {
            _layerControl.Zoom = 2f;

            _pointerController = new PointerEventController(_layerControl);
            _layerControl.MouseClick += _pointerController.TargetMouseClick;

            _pointerResponder = new LocalPointerEventResponder(this);
            _pointerController.Responder = _pointerResponder;

            _rootLayer = new GroupLayerPresenter();
            _layerControl.RootLayer = new GroupLayer(_rootLayer);
        }
示例#4
0
        private void InitializeLayerHierarchy()
        {
            _rootContentLayer = new GroupLayerPresenter();
            _gridLayer = new GridLayerPresenter() {
                IsVisible = false,
            };

            _rootLayer = new GroupLayerPresenter();
            _rootLayer.Layers.Add(new WorkspaceLayerPresenter());
            _rootLayer.Layers.Add(_rootContentLayer);
            _rootLayer.Layers.Add(_gridLayer);
            _rootLayer.Layers.Add(new AnnotationLayerPresenter() {
                Annotations = _annotations,
            });
        }
        private void InitializeLayerHierarchy()
        {
            _tileLayer = new TileSetLayerPresenter(_tileSet);
            _tileLayer.TileSelected += TileSelected;

            _gridLayer = new GridLayerPresenter() {
                GridSpacingX = _tilePool.TileWidth,
                GridSpacingY = _tilePool.TileHeight,
            };
            _annotLayer = new AnnotationLayerPresenter() {
                Annotations = _annotations,
            };

            _rootLayer = new GroupLayerPresenter();
            _rootLayer.Layers.Add(_tileLayer);
            //_rootLayer.Layers.Add(_gridLayer);
            _rootLayer.Layers.Add(_annotLayer);
        }
示例#6
0
        private void InitializeLayerHierarchy(LevelPresenter presenter)
        {
            _rootContentLayer = new GroupLayerPresenter();
            _rootLayer = new GroupLayerPresenter();

            if (presenter != null) {
                _rootLayer.Layers.Add(_rootContentLayer);
                _rootLayer.Layers.Add(new AnnotationLayerPresenter() {
                    Annotations = _annotations,
                });
            }
        }