RenderServices

Namespace: Murder.Services
Assembly: Murder.dll

public static class RenderServices

⭐ Properties

BLEND_COLOR_ONLY

public static Vector3 BLEND_COLOR_ONLY;

Returns
Vector3

BLEND_NORMAL

public static Vector3 BLEND_NORMAL;

Returns
Vector3

BLEND_WASH

public static Vector3 BLEND_WASH;

Returns
Vector3

⭐ Methods

DrawVerticalMenu(Batch2D, Point&, Point&, DrawMenuStyle&, MenuInfo&)

public DrawMenuInfo DrawVerticalMenu(Batch2D batch, Point& position, Point& textPosition, DrawMenuStyle& style, MenuInfo& menuInfo)

Parameters
batch Batch2D
position Point&
textPosition Point&
style DrawMenuStyle&
menuInfo MenuInfo&

Returns
DrawMenuInfo

DrawVerticalMenu(Batch2D, Point&, DrawMenuStyle&, MenuInfo&)

public DrawMenuInfo DrawVerticalMenu(Batch2D batch, Point& position, DrawMenuStyle& style, MenuInfo& menuInfo)

Parameters
batch Batch2D
position Point&
style DrawMenuStyle&
menuInfo MenuInfo&

Returns
DrawMenuInfo

CurrentTime(AnimationInfo)

public float CurrentTime(AnimationInfo this)

Fetch the current time for this animation.

Parameters
this AnimationInfo

Returns
float

YSort(float)

public float YSort(float y)

Parameters
y float

Returns
float

DrawSprite(Batch2D, SpriteAsset, Vector2, DrawInfo, AnimationInfo)

public FrameInfo DrawSprite(Batch2D batch, SpriteAsset asset, Vector2 position, DrawInfo drawInfo, AnimationInfo animationInfo)

Parameters
batch Batch2D
asset SpriteAsset
position Vector2
drawInfo DrawInfo
animationInfo AnimationInfo

Returns
FrameInfo

DrawSprite(Batch2D, SpriteAsset, Vector2, T?)

public FrameInfo DrawSprite(Batch2D batch, SpriteAsset assetGuid, Vector2 position, T? drawInfo)

Parameters
batch Batch2D
assetGuid SpriteAsset
position Vector2
drawInfo T?

Returns
FrameInfo

DrawSprite(Batch2D, Guid, float, float, DrawInfo, AnimationInfo)

public FrameInfo DrawSprite(Batch2D batch, Guid assetGuid, float x, float y, DrawInfo drawInfo, AnimationInfo animationInfo)

Parameters
batch Batch2D
assetGuid Guid
x float
y float
drawInfo DrawInfo
animationInfo AnimationInfo

Returns
FrameInfo

DrawSprite(Batch2D, Guid, Vector2, DrawInfo, AnimationInfo)

public FrameInfo DrawSprite(Batch2D batch, Guid assetGuid, Vector2 position, DrawInfo drawInfo, AnimationInfo animationInfo)

Parameters
batch Batch2D
assetGuid Guid
position Vector2
drawInfo DrawInfo
animationInfo AnimationInfo

Returns
FrameInfo

DrawSprite(Batch2D, Guid, Vector2, T?)

public FrameInfo DrawSprite(Batch2D batch, Guid assetGuid, Vector2 position, T? drawInfo)

Parameters
batch Batch2D
assetGuid Guid
position Vector2
drawInfo T?

Returns
FrameInfo

DrawSprite(Batch2D, Vector2, Rectangle, string, SpriteAsset, float, float, bool, Vector2, bool, float, Vector2, Color, Vector3, float, float)

public FrameInfo DrawSprite(Batch2D spriteBatch, Vector2 pos, Rectangle clip, string animationId, SpriteAsset ase, float animationStartedTime, float animationDuration, bool animationLoop, Vector2 origin, bool flipped, float rotation, Vector2 scale, Color color, Vector3 blend, float sort, float currentTime)

The Renders a sprite on the screen. This is the most basic rendering method with all parameters exposed, avoid using this if possible.

Parameters
spriteBatch Batch2D

pos Vector2

clip Rectangle

animationId string

ase SpriteAsset

animationStartedTime float

animationDuration float

animationLoop bool

origin Vector2

flipped bool

rotation float

scale Vector2

color Color

blend Vector3

sort float

currentTime float

Returns
FrameInfo

DrawSimpleText(Batch2D, int, string, Vector2, DrawInfo)

public Point DrawSimpleText(Batch2D uiBatch, int pixelFont, string text, Vector2 position, DrawInfo drawInfo)

Draw a simple text. Without line wrapping, color formatting, line splitting or anything fancy.

Parameters
uiBatch Batch2D
pixelFont int
text string
position Vector2
drawInfo DrawInfo

Returns
Point

DrawText(Batch2D, MurderFonts, string, Vector2, int, int, T?)

public Point DrawText(Batch2D uiBatch, MurderFonts font, string text, Vector2 position, int maxWidth, int visibleCharacters, T? drawInfo)

Parameters
uiBatch Batch2D
font MurderFonts
text string
position Vector2
maxWidth int
visibleCharacters int
drawInfo T?

Returns
Point

DrawText(Batch2D, MurderFonts, string, Vector2, int, T?)

public Point DrawText(Batch2D uiBatch, MurderFonts font, string text, Vector2 position, int maxWidth, T? drawInfo)

Parameters
uiBatch Batch2D
font MurderFonts
text string
position Vector2
maxWidth int
drawInfo T?

Returns
Point

DrawText(Batch2D, MurderFonts, string, Vector2, T?)

public Point DrawText(Batch2D uiBatch, MurderFonts font, string text, Vector2 position, T? drawInfo)

Parameters
uiBatch Batch2D
font MurderFonts
text string
position Vector2
drawInfo T?

Returns
Point

DrawText(Batch2D, int, string, Vector2, int, T?)

public Point DrawText(Batch2D uiBatch, int font, string text, Vector2 position, int maxWidth, T? drawInfo)

Parameters
uiBatch Batch2D
font int
text string
position Vector2
maxWidth int
drawInfo T?

Returns
Point

DrawText(Batch2D, int, string, Vector2, T?)

public Point DrawText(Batch2D uiBatch, int font, string text, Vector2 position, T? drawInfo)

Parameters
uiBatch Batch2D
font int
text string
position Vector2
drawInfo T?

Returns
Point

DrawText(Batch2D, int, string, Vector2, int, int, DrawInfo)

public Point DrawText(Batch2D uiBatch, int pixelFont, string text, Vector2 position, int maxWidth, int visibleCharacters, DrawInfo drawInfo)

Parameters
uiBatch Batch2D
pixelFont int
text string
position Vector2
maxWidth int
visibleCharacters int
drawInfo DrawInfo

Returns
Point

FetchPortraitAsSprite(Portrait)

public T? FetchPortraitAsSprite(Portrait portrait)

Parameters
portrait Portrait

Returns
T?

CreateGameplayScreenShot()

public Texture2D CreateGameplayScreenShot()

Don't forget to dispose this!

Returns
Texture2D

Draw3Slice(Batch2D, AtlasCoordinates, Rectangle, Vector2, Vector2, Vector2, Orientation, float)

public void Draw3Slice(Batch2D batch, AtlasCoordinates texture, Rectangle core, Vector2 position, Vector2 size, Vector2 origin, Orientation orientation, float sort)

Parameters
batch Batch2D
texture AtlasCoordinates
core Rectangle
position Vector2
size Vector2
origin Vector2
orientation Orientation
sort float

Draw9Slice(Batch2D, AtlasCoordinates, IntRectangle, IntRectangle, NineSliceStyle, DrawInfo)

public void Draw9Slice(Batch2D batch, AtlasCoordinates texture, IntRectangle core, IntRectangle target, NineSliceStyle style, DrawInfo info)

Parameters
batch Batch2D
texture AtlasCoordinates
core IntRectangle
target IntRectangle
style NineSliceStyle
info DrawInfo

Draw9Slice(Batch2D, AtlasCoordinates, Rectangle, Rectangle, float)

public void Draw9Slice(Batch2D batch, AtlasCoordinates texture, Rectangle core, Rectangle target, float sort)

Parameters
batch Batch2D
texture AtlasCoordinates
core Rectangle
target Rectangle
sort float

Draw9Slice(Batch2D, Guid, Rectangle, DrawInfo, AnimationInfo)

public void Draw9Slice(Batch2D batch, Guid guid, Rectangle target, DrawInfo drawInfo, AnimationInfo animationInfo)

Draws a 9-slice using the given texture and target rectangle. The core rectangle is specified in the Aseprite file

Parameters
batch Batch2D
guid Guid
target Rectangle
drawInfo DrawInfo
animationInfo AnimationInfo

Draw9Slice(Batch2D, Guid, Rectangle, DrawInfo)

public void Draw9Slice(Batch2D batch, Guid guid, Rectangle target, DrawInfo drawInfo)

Draws a 9-slice using the given texture and target rectangle. The core rectangle is specified in the Aseprite file

Parameters
batch Batch2D
guid Guid
target Rectangle
drawInfo DrawInfo

Draw9Slice(Batch2D, Guid, Rectangle, NineSliceStyle, DrawInfo, AnimationInfo)

public void Draw9Slice(Batch2D batch, Guid guid, Rectangle target, NineSliceStyle style, DrawInfo drawInfo, AnimationInfo animationInfo)

Draws a 9-slice using the given texture and target rectangle. The core rectangle is specified in the Aseprite file

Parameters
batch Batch2D
guid Guid
target Rectangle
style NineSliceStyle
drawInfo DrawInfo
animationInfo AnimationInfo

DrawCircleOutline(Batch2D, Point, float, int, Color, float)

public void DrawCircleOutline(Batch2D spriteBatch, Point center, float radius, int sides, Color color, float sort)

Parameters
spriteBatch Batch2D
center Point
radius float
sides int
color Color
sort float

DrawCircleOutline(Batch2D, Rectangle, int, Color)

public void DrawCircleOutline(Batch2D spriteBatch, Rectangle rectangle, int sides, Color color)

Parameters
spriteBatch Batch2D
rectangle Rectangle
sides int
color Color

DrawCircleOutline(Batch2D, Vector2, float, int, Color, float)

public void DrawCircleOutline(Batch2D spriteBatch, Vector2 center, float radius, int sides, Color color, float sort)

Draw a circle

Parameters
spriteBatch Batch2D

center Vector2

radius float

sides int

color Color

sort float

DrawFilledCircle(Batch2D, Rectangle, int, DrawInfo)

public void DrawFilledCircle(Batch2D batch, Rectangle circleRect, int steps, DrawInfo drawInfo)

Parameters
batch Batch2D
circleRect Rectangle
steps int
drawInfo DrawInfo

DrawFilledCircle(Batch2D, Vector2, float, int, T?)

public void DrawFilledCircle(Batch2D batch, Vector2 center, float radius, int steps, T? drawInfo)

Parameters
batch Batch2D
center Vector2
radius float
steps int
drawInfo T?

DrawHorizontalLine(Batch2D, int, int, int, Color, float)

public void DrawHorizontalLine(Batch2D spriteBatch, int x, int y, int length, Color color, float sorting)

Parameters
spriteBatch Batch2D
x int
y int
length int
color Color
sorting float

DrawIndexedVertices(Matrix, GraphicsDevice, T[], int, Int16[], int, Effect, BlendState, Texture2D, bool)

public void DrawIndexedVertices(Matrix matrix, GraphicsDevice graphicsDevice, T[] vertices, int vertexCount, Int16[] indices, int primitiveCount, Effect effect, BlendState blendState, Texture2D texture, bool smoothing)

Parameters
matrix Matrix
graphicsDevice GraphicsDevice
vertices T[]
vertexCount int
indices short[]
primitiveCount int
effect Effect
blendState BlendState
texture Texture2D
smoothing bool

DrawLine(Batch2D, Point, Point, Color, float)

public void DrawLine(Batch2D spriteBatch, Point point1, Point point2, Color color, float sort)

Parameters
spriteBatch Batch2D
point1 Point
point2 Point
color Color
sort float

DrawLine(Batch2D, Vector2, float, float, Color, float)

public void DrawLine(Batch2D spriteBatch, Vector2 point, float length, float angle, Color color, float sort)

Parameters
spriteBatch Batch2D
point Vector2
length float
angle float
color Color
sort float

DrawLine(Batch2D, Vector2, float, float, Color, float, float)

public void DrawLine(Batch2D spriteBatch, Vector2 point, float length, float angle, Color color, float thickness, float sort)

Parameters
spriteBatch Batch2D
point Vector2
length float
angle float
color Color
thickness float
sort float

DrawLine(Batch2D, Vector2, Vector2, Color, float)

public void DrawLine(Batch2D spriteBatch, Vector2 point1, Vector2 point2, Color color, float sort)

Parameters
spriteBatch Batch2D
point1 Vector2
point2 Vector2
color Color
sort float

DrawLine(Batch2D, Vector2, Vector2, Color, float, float)

public void DrawLine(Batch2D spriteBatch, Vector2 point1, Vector2 point2, Color color, float thickness, float sort)

Parameters
spriteBatch Batch2D
point1 Vector2
point2 Vector2
color Color
thickness float
sort float

DrawPoint(Batch2D, Point, Color, float)

public void DrawPoint(Batch2D spriteBatch, Point pos, Color color, float sorting)

Parameters
spriteBatch Batch2D
pos Point
color Color
sorting float

DrawPoints(Batch2D, Vector2, Vector2[], Color, float)

public void DrawPoints(Batch2D spriteBatch, Vector2 position, Vector2[] points, Color color, float thickness)

Draws a list of connecting points

Parameters
spriteBatch Batch2D

position Vector2

points Vector2[]

color Color

thickness float

DrawPoints(Batch2D, Vector2, ReadOnlySpan, Color, float)

public void DrawPoints(Batch2D spriteBatch, Vector2 position, ReadOnlySpan<T> points, Color color, float thickness)

Draws a list of connecting points

Parameters
spriteBatch Batch2D

position Vector2

points ReadOnlySpan<T>

color Color

thickness float

DrawPolygon(Batch2D, ImmutableArray, T?)

public void DrawPolygon(Batch2D batch, ImmutableArray<T> vertices, T? drawInfo)

Parameters
batch Batch2D
vertices ImmutableArray<T>
drawInfo T?

DrawQuad(Rectangle, Color)

public void DrawQuad(Rectangle rect, Color color)

Parameters
rect Rectangle
color Color

DrawQuadOutline(Rectangle, Color)

public void DrawQuadOutline(Rectangle rect, Color color)

Parameters
rect Rectangle
color Color

DrawRectangle(Batch2D, Rectangle, Color, float)

public void DrawRectangle(Batch2D batch, Rectangle rectangle, Color color, float sorting)

Parameters
batch Batch2D
rectangle Rectangle
color Color
sorting float

DrawRectangleOutline(Batch2D, Rectangle, Color, int, float)

public void DrawRectangleOutline(Batch2D spriteBatch, Rectangle rectangle, Color color, int lineWidth, float sorting)

Parameters
spriteBatch Batch2D
rectangle Rectangle
color Color
lineWidth int
sorting float

DrawRectangleOutline(Batch2D, Rectangle, Color, int)

public void DrawRectangleOutline(Batch2D spriteBatch, Rectangle rectangle, Color color, int lineWidth)

Parameters
spriteBatch Batch2D
rectangle Rectangle
color Color
lineWidth int

DrawRectangleOutline(Batch2D, Rectangle, Color)

public void DrawRectangleOutline(Batch2D spriteBatch, Rectangle rectangle, Color color)

Parameters
spriteBatch Batch2D
rectangle Rectangle
color Color

DrawRepeating(Batch2D, AtlasCoordinates, Rectangle, float)

public void DrawRepeating(Batch2D batch, AtlasCoordinates texture, Rectangle area, float sort)

Parameters
batch Batch2D
texture AtlasCoordinates
area Rectangle
sort float

DrawTexture(Batch2D, Texture2D, Vector2, DrawInfo)

public void DrawTexture(Batch2D batch, Texture2D texture, Vector2 position, DrawInfo drawInfo)

Parameters
batch Batch2D
texture Texture2D
position Vector2
drawInfo DrawInfo

DrawTextureQuad(Texture2D, Rectangle, Rectangle, Matrix, Color, BlendState, Effect, Vector3)

public void DrawTextureQuad(Texture2D texture, Rectangle source, Rectangle destination, Matrix matrix, Color color, BlendState blend, Effect shaderEffect, Vector3 colorBlend)

Parameters
texture Texture2D
source Rectangle
destination Rectangle
matrix Matrix
color Color
blend BlendState
shaderEffect Effect
colorBlend Vector3

DrawTextureQuad(Texture2D, Rectangle, Rectangle, Matrix, Color, BlendState, Effect)

public void DrawTextureQuad(Texture2D texture, Rectangle source, Rectangle destination, Matrix matrix, Color color, BlendState blend, Effect shaderEffect)

Parameters
texture Texture2D
source Rectangle
destination Rectangle
matrix Matrix
color Color
blend BlendState
shaderEffect Effect

DrawTextureQuad(Texture2D, Rectangle, Rectangle, Matrix, Color, BlendState)

public void DrawTextureQuad(Texture2D texture, Rectangle source, Rectangle destination, Matrix matrix, Color color, BlendState blend)

Parameters
texture Texture2D
source Rectangle
destination Rectangle
matrix Matrix
color Color
blend BlendState

DrawTextureQuad(Texture2D, Rectangle, Rectangle, Matrix, Color, Effect, BlendState, bool)

public void DrawTextureQuad(Texture2D texture, Rectangle source, Rectangle destination, Matrix matrix, Color color, Effect effect, BlendState blend, bool smoothing)

Parameters
texture Texture2D
source Rectangle
destination Rectangle
matrix Matrix
color Color
effect Effect
blend BlendState
smoothing bool

DrawVerticalLine(Batch2D, int, int, int, Color, float)

public void DrawVerticalLine(Batch2D spriteBatch, int x, int y, int length, Color color, float sorting)

Parameters
spriteBatch Batch2D
x int
y int
length int
color Color
sorting float

MessageCompleteAnimations(Entity, SpriteComponent)

public void MessageCompleteAnimations(Entity e, SpriteComponent s)

Parameters
e Entity
s SpriteComponent

MessageCompleteAnimations(Entity)

public void MessageCompleteAnimations(Entity e)

Parameters
e Entity

TriggerEventsIfNeeded(Entity, RenderedSpriteCacheComponent, bool)

public void TriggerEventsIfNeeded(Entity e, RenderedSpriteCacheComponent cache, bool useUnscaledTime)

Parameters
e Entity
cache RenderedSpriteCacheComponent
useUnscaledTime bool

TriggerEventsIfNeeded(Entity, RenderedSpriteCacheComponent, float, float)

public void TriggerEventsIfNeeded(Entity e, RenderedSpriteCacheComponent cache, float previousTime, float currentTime)

Parameters
e Entity
cache RenderedSpriteCacheComponent
previousTime float
currentTime float