Пример #1
0
        public static void Initialize()
        {
            CanFullscreen = true;
            graphicsDevice = graphicsDeviceManager.GraphicsDevice;
            spriteBatch = new SpriteBatch(GraphicsDevice);
            gameWindow = Wrack.Game.Window;

            WhitePixel = new Texture2D(GraphicsDevice, 1, 1);
            WhitePixel.SetData<Color>(new Color[] { new Color(255, 255, 255, 255) });

            Default3x3Texture = new Texture2D(GraphicsDevice, 3, 3);
            Default3x3Texture.SetData<Color>(new Color[] { new Color(255, 255, 255, 255), new Color(255, 255, 255, 255), new Color(255, 255, 255, 255), new Color(255, 255, 255, 255), new Color(255, 255, 255, 255), new Color(255, 255, 255, 255), new Color(255, 255, 255, 255), new Color(255, 255, 255, 255), new Color(255, 255, 255, 255) });

            DefaultHollow3x3Texture = new Texture2D(GraphicsDevice, 3, 3);
            DefaultHollow3x3Texture.SetData<Color>(new Color[] { new Color(255, 255, 255, 255), new Color(255, 255, 255, 255), new Color(255, 255, 255, 255), new Color(255, 255, 255, 255), Color.Transparent, new Color(255, 255, 255, 255), new Color(255, 255, 255, 255), new Color(255, 255, 255, 255), new Color(255, 255, 255, 255) });

            Cameras = new Dictionary<string, Camera>();
            Textures = new Dictionary<string, Texture2D>();
            Fonts = new Dictionary<string, SpriteFont>();
            Effects = new Dictionary<string, Effect>();
            AnimationSets = new Dictionary<string, Dictionary<string, Animation>>();

            CurrentCamera = new Camera();
            Cameras.Add("default", CurrentCamera);
            Textures.Add("default", WhitePixel);
            Textures.Add("default3x3", Default3x3Texture);
            Textures.Add("defaulth3x3", DefaultHollow3x3Texture);
            Textures.Add("null", null);
            Textures.Add(Input.NULL_STRING, GetTexture("null"));
            Fonts.Add("default", DefaultFont);
        }
Пример #2
0
 public static void AddCamera(string name, Camera camera)
 {
     if (Cameras.ContainsKey(name)) Cameras[name] = camera;
     else Cameras.Add(name, camera);
 }