public static KeyValuePair <TextureAtlasManager, Action> CreateUIOnly(IGraphicProvider graphicProvider, IFontProvider fontProvider)
        {
            var textureAtlasManager = new TextureAtlasManager();

            return(KeyValuePair.Create <TextureAtlasManager, Action>(textureAtlasManager, () =>
            {
                textureAtlasManager.AddUI(graphicProvider, false);
                textureAtlasManager.AddCursors(graphicProvider);
                textureAtlasManager.AddFont(fontProvider);
            }));
        }
Exemple #2
0
        public Cursor(IRenderView renderView, IReadOnlyList <Position> cursorHotspots, TextureAtlasManager textureAtlasManager = null)
        {
            this.renderView     = renderView;
            textureAtlas        = (textureAtlasManager ?? TextureAtlasManager.Instance).GetOrCreate(Layer.Cursor);
            sprite              = renderView.SpriteFactory.Create(16, 16, true);
            sprite.PaletteIndex = 0;
            sprite.Layer        = renderView.GetLayer(Layer.Cursor);

            for (int i = 0; i < cursorHotspots.Count; ++i)
            {
                this.cursorHotspots.Add((CursorType)i, cursorHotspots[i]);
            }

            UpdateCursor();
        }