Пример #1
0
 private void DefaultValues()
 {
     OpenTextures();
     _selectionRect    = ShapeGenerator.GenerateBorder(CurrentMap.TextureMap.TileWidth, CurrentMap.TextureMap.TileHeight, 2, Color.White);
     _collisionTexture = ShapeGenerator.GenerateRectangle(CurrentMap.TextureMap.TileWidth, CurrentMap.TextureMap.TileHeight, Color.White);
     _mapPosition      = Vector2.Zero;
     // _selectionTilePos = Point.Zero;
     _selectionX           = 0;
     _selectionY           = 0;
     CurrentEditorRow      = 0;
     EditorDraw.CurrentMap = CurrentMap;
     _zoom = 1f;
 }
Пример #2
0
        public void Load(ContentManager content)
        {
            _contentLoader         = content;
            _toolBarTexture        = ShapeGenerator.GenerateRectangle(Game1.Width, 100, new Color(50, 50, 50));
            _buttonToolsFillBucket = new Button(content, "Tools/fillBucket");
            _buttonToolsFillBucket.SetEvent(ToggleFillBucket);
            _buttonToolsFillBucket.Position = _toolsFillBucketPos;


            //-----| Fill stuff |------------------
            _buttonToolsFillRectangle = new Button(content, "Tools/fillRectangle");
            _buttonToolsFillRectangle.SetEvent(ToggleFillRectangle);
            _buttonToolsFillRectangle.Position = _toolsFillRectanglePos;
            //-------------------------------------
            _mapBackground = ShapeGenerator.GenerateRectangle(32, 32, new Color(50, 50, 80));

            CreateNewMap();
            DefaultValues();
        }
Пример #3
0
 private void OpenTextures()
 {
     _mapTexture = _contentLoader.Load <Texture2D>(CurrentMap.TextureMap.TileTexture);
     CurrentMap.TextureMap.SetTileDimensions(_mapTexture.Width, _mapTexture.Height);
     if ((_mapTexture.Width * _toolBarZoom) > Game1.Width)
     {
         float scrollRatio = (Game1.Width / (_mapTexture.Width * _toolBarZoom));
         _toolbarScrollWidth = Game1.Width * scrollRatio;
         if (_toolbarScrollWidth < 10)
         {
             _toolbarScrollWidth = 10;
         }
     }
     else
     {
         _toolbarScrollWidth = Game1.Width;
     }
     _toolbarScroll    = ShapeGenerator.GenerateRectangle((int)_toolbarScrollWidth, 16, Color.White);
     _toolbarScrollPos = Vector2.Zero;
     _toolbarPos       = Vector2.Zero;
     _tileSelectionID  = 0;
 }
Пример #4
0
 public static void Load(ContentManager content)
 {
     _fontEditor     = content.Load <SpriteFont>("EditorFont");
     _textBackground = ShapeGenerator.GenerateRectangle(200, 200, Color.Black);
     _fontHeight     = (int)_fontEditor.MeasureString("Aq").X;
 }