Click or drag to resize
Ab4d.SharpEngine logo

SpriteBatchDrawSprite(Vector2, Single, Single, Single) Method

DrawSprite method draws the current texture to the specified position and using the specified scale (1 by default) and rotation (0 by default). See remarks for more info.

Namespace: Ab4d.SharpEngine.Utilities
Assembly: Ab4d.SharpEngine (in Ab4d.SharpEngine.dll) Version: 2.0.8956+4c7684e186ca1be74e7a284fbe739d9a1b843d3c
Syntax
C#
public void DrawSprite(
	Vector2 topLeftPosition,
	float scaleX = 1f,
	float scaleY = 1f,
	float rotationAngleDegrees = 0f
)

Parameters

topLeftPosition  Vector2
position as Vector2
scaleX  Single  (Optional)
scale x (1 by default)
scaleY  Single  (Optional)
scale Y (1 by default)
rotationAngleDegrees  Single  (Optional)
clockwise rotation angle in degrees (0 by default)
Remarks

DrawSprite method draws the current texture to the specified position and using the specified scale (1 by default) and rotation (0 by default).

Before calling this method, the current texture must be set by calling the SetSpriteTexture(GpuImage) method.

The topLeftPosition can be defined By default the position is specified in relative coordinates (from 0 to 1). When useAbsoluteCoordinates is true, then absolute coordinates are used (from 0 to size of view).

When rotationAngleDegrees is specified (0 by default), then the sprite is rotated around the center position.

When IsUsingDpiScale is true, then size of view is defined as (sceneView.Width / DpiScaleX, sceneView.Height / DpiScaleY). When IsUsingDpiScale is false (by default) then size of the view is the same as size of the SceneView. Absolute coordinates can be used only when this SpriteBatch is created from SceneView.

See Also