/// <summary> /// Renders a specified texture onto a RenderTexture or the GameScreen (if renderTarget is passed as null) at the /// coordinates given using a specified blending mode. /// </summary> /// <param name="tex">The texture to draw</param> /// <param name="dx">X coordinate on the renderTarget to draw to.</param> /// <param name="dy">Y coordinate on the renderTarget to draw to.</param> /// <param name="sx">X coordinate on the source texture to grab from.</param> /// <param name="sy">Y coordinate on the source texture to grab from.</param> /// <param name="w">Width of the texture part we are rendering.</param> /// <param name="h">Height of the texture part we are rendering.</param> /// <param name="renderTarget">>Where to draw to. If null it this will draw to the game screen.</param> /// <param name="blendMode">Which blend mode to use when rendering</param> public static void DrawGameTexture( GameTexture tex, float dx, float dy, float sx, float sy, float w, float h, GameRenderTexture renderTarget = null, GameBlendModes blendMode = GameBlendModes.None, GameShader shader = null, float rotationDegrees = 0.0f, bool drawImmediate = false ) { if (tex == null) { return; } Renderer.DrawTexture( tex, sx, sy, w, h, dx, dy, w, h, Color.White, renderTarget, blendMode, shader, rotationDegrees, false, drawImmediate ); }