Sprite |
public void DrawSprite( Vector2 topLeftPosition, Color4 colorMask, float scaleX = 1f, float scaleY = 1f, float rotationAngleDegrees = 0f, bool isPreMultipliedAlpha = false )
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 specified in relative coordinates (valid range is from 0 to 1) or in absolute coordinates (valid range is from 0 to size of view). Absolute coordinates are supported only when the SpriteBatch is created from SceneView (in this case the AreAbsoluteCoordinatesSupported is true). To use absolute coordinates call Begin(Boolean, Int32) method and set useAbsoluteCoordinates parameter to true or set the IsUsingAbsoluteCoordinates property to true.
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.