public static void ReloadTextures(EventHandler <LoadProgressUpdatedEventArgs> updateEventHandler) { ITextureLoadStrategy resourceLoadStrategy; if (!LoadingWindowViewModel.Settings.GraphicsIsPackedResource) { resourceLoadStrategy = new FolderLoadStrategy(LoadingWindowViewModel.Settings.GraphicsFormat); } else { resourceLoadStrategy = new TCDLoadStrategy( LoadingWindowViewModel.Settings.GraphicsResourceFile, LoadingWindowViewModel.Settings.GraphicsResourceFilePassword, LoadingWindowViewModel.Settings.GraphicsResourceFileFormat); } var progressUpdateAction = default(EventHandler <LoadProgressUpdatedEventArgs>); progressUpdateAction = (sender, args) => { updateEventHandler(sender, args); if (args == null) { resourceLoadStrategy.ProgressUpdated -= progressUpdateAction; } }; resourceLoadStrategy.ProgressUpdated += progressUpdateAction; resourceLoadStrategy.Load(); Constants.TextureLoadStrategy = resourceLoadStrategy; }
public SpriteRendererPanel(ITextureLoadStrategy textureLoadStrategy, double?initialScaleX, double?initialScaleY) { this.textureLoadStrategy = textureLoadStrategy; this.initialScaleX = initialScaleX; this.initialScaleY = initialScaleY; this.Load += this.GLControlOnLoad; this.Resize += this.GLControlOnResize; this.renderedObjects = new Dictionary <int, RenderedObjectCollection>(); this.renderScaleX = 1; this.renderScaleY = 1; this.MouseDown += SpriteRendererPanel_MouseDown; this.MouseMove += SpriteRendererPanel_MouseMove; this.MouseUp += SpriteRendererPanel_MouseUp; this.MouseEnter += SpriteRendererPanel_MouseEnter; this.MouseHover += SpriteRendererPanel_MouseHover; this.MouseLeave += SpriteRendererPanel_MouseLeave; }
public SpriteRendererPanel(ITextureLoadStrategy textureLoadStrategy, double?initialScale) : this(textureLoadStrategy, initialScale, initialScale) { }
public SpriteRendererPanel(ITextureLoadStrategy textureLoadStrategy) : this(textureLoadStrategy, null) { this.backgroundColor = SpriteRendererPanel.DefaultBackgroundColor; }