예제 #1
0
        public SpriteSheet(IContentLibrary contentLibrary)
        {
            _spriteLoader = new SpriteLoader(contentLibrary);
            Components.Add(_spriteLoader);

            Frames = new List <Rectangle>();
        }
예제 #2
0
 public async Task LoadContentLocal(IContentLibrary contentLibrary)
 {
     if (Asset != null)
     {
         Font = await contentLibrary.GetAsset <SpriteFont>(Asset).GetContentAsync();
     }
 }
예제 #3
0
        public async Task LoadContent(IContentLibrary contentLibrary)
        {
            await Task.WhenAll(new List <Task>(Effects.Select(x => x.LoadContent(contentLibrary, _lazyGraphicsDevice())))
            {
                _spriteTargetA.LoadContent(contentLibrary),
                _spriteTargetB.LoadContent(contentLibrary)
            });

            Loaded?.Invoke(this);
        }
예제 #4
0
        public async Task LoadContent(IContentLibrary contentLibrary)
        {
            if (IsDisposed)
            {
                return;
            }

            await Schedulers.LoadContent.RunScheduleAsync(contentLibrary);

            _contentLoaded = true;
        }
예제 #5
0
        public Task LoadContent(IContentLibrary contentLibrary)
        {
            GraphicsDevice graphicsDevice = _graphicsDeviceFunc();

            _defaultEffect = new BasicEffect(graphicsDevice)
            {
                VertexColorEnabled = true
            };

            RefreshBuffers();

            return(Task.CompletedTask);
        }
예제 #6
0
        public async Task LoadContent(IContentLibrary contentLibrary)
        {
            await _spriteLoader.LoadContent(contentLibrary);

            if (Carver != null)
            {
                ApplyCarver(Carver);
            }

            Refresh();
            _loadedContent = true;

            Loaded?.Invoke(this);
        }
예제 #7
0
        public async Task LoadContent(IContentLibrary contentLibrary)
        {
            await Task.WhenAll(Components.Select(async x => await x.LoadContent(contentLibrary)));

            if (Carver != null)
            {
                foreach (SpriteSheet spriteSheet in Components)
                {
                    spriteSheet.ApplyCarver(Carver);
                }
            }

            Refresh();
            _loadedContent = true;

            Loaded?.Invoke(this);
        }
예제 #8
0
 public Task LoadContent(IContentLibrary contentLibrary) => TaskDelegate(contentLibrary);
예제 #9
0
 public async Task LoadContent(IContentLibrary contentLibrary)
 {
     await _rectangleSprite.LoadContent(contentLibrary);
 }
예제 #10
0
 public abstract Task LoadContent(IContentLibrary contentLibrary, GraphicsDevice graphicsDevice);
예제 #11
0
 private IContentLibraryContext GetContext(IContentLibrary provider)
 {
     IHostServices services = new Mock.HostServicesMockup();
     ITridionUser user = new Mock.TridionUserMockup()
     {
         FullName = "Unit Test",
         UserName = "******",
         Id = "tcm:0-1-65536",
         IsAdministrator = true,
         IsTrustedReadOnlyMode = true
     };
     IEclSession session = new Mock.EclSessionMockup(services, user);
     var context = provider.CreateContext(session);
     return context;
 }
예제 #12
0
 public SpriteSheetSplit(IContentLibrary contentLibrary)
 {
     _contentLibrary = contentLibrary;
 }
예제 #13
0
 public async Task LoadContent(IContentLibrary contentLibrary)
 {
     await Task.WhenAll(_assets.Select(async x => _soundEffects[x.Key] = await contentLibrary.GetAsset <SoundEffect>(x.Value).GetContentAsync()));
 }
예제 #14
0
        public async Task LoadContent(IContentLibrary contentLibrary)
        {
            _texture = await GenerateTexture();

            Loaded?.Invoke(this);
        }
예제 #15
0
        public override async Task LoadContent(IContentLibrary contentLibrary, GraphicsDevice graphicsDevice)
        {
            MaskRender = new RenderTarget2D(graphicsDevice, _effectTargetRectangle.Width, _effectTargetRectangle.Height);

            _square = await contentLibrary.GetAsset <Texture2D>("Glyph/square").GetContentAsync();
        }