public void PatchAreaDraw(string id, Texture2D targetTexture, Func <Texture2D, bool> predicate, Texture2D patch, Rectangle?sourceRectangle, Func <Rectangle> getTargetTileArea) { id = $"{Plato.ModHelper.ModRegistry.ModID}.{id}"; SpriteBatchPatches.DrawPatches.RemoveWhere(p => p.Id == id); SpriteBatchPatches.DrawPatches.Add(new AreaDrawPatch(id, targetTexture, predicate, patch, getTargetTileArea, sourceRectangle)); SpriteBatchPatches.InitializePatch(); }
public void PatchTileDraw(string id, Texture2D targetTexture, Func <Texture2D, bool> predicate, Texture2D patch, Rectangle?sourceRectangle, Func <int> getIndex, int tileWidth = 16, int tileHeight = 16) { id = $"{Plato.ModHelper.ModRegistry.ModID}.{id}"; SpriteBatchPatches.DrawPatches.RemoveWhere(p => p.Id == id); SpriteBatchPatches.DrawPatches.Add(new AreaDrawPatch(id, targetTexture, predicate, patch, () => Game1.getSourceRectForStandardTileSheet(targetTexture, getIndex(), tileWidth, tileHeight), sourceRectangle)); SpriteBatchPatches.InitializePatch(); }
public Texture2D GetDrawHandle <TData>(string id, TData data, Func <ITextureDrawHandler, bool> handler, int width, int height, GraphicsDevice graphicsDevice = null) { SpriteBatchPatches.InitializePatch(); return(new PlatoTexture <TData>(id, data, handler, width, height, graphicsDevice ?? Game1.graphics.GraphicsDevice)); }
public Texture2D GetDrawHandle <TData>(string id, TData data, Func <ITextureDrawHandler <TData>, bool> handler, Texture2D texture) { SpriteBatchPatches.InitializePatch(); return(new PlatoTexture <TData>(id, data, handler, texture, texture?.GraphicsDevice)); }