Sprite |
public void DrawSprite( Vector2 topLeftPosition, Vector2 spriteSize, float rotationAngleDegrees = 0f )
DrawSprite method draws the current texture to the specified position, size and and rotation (0 by default).
Before calling this method, the current texture must be set by calling the SetSpriteTexture(GpuImage) method.
When size is set to (0, 0), then the actual size of the texture is used.
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.