Created
May 29, 2016 17:12
-
-
Save KyleGobel/4e7a9791da4a618ed08ea328fc5181f5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// _guiTexture is a texture of a bunch of gui images (buttons, scrollbars panels ect) | |
// srcRectangle in this case is the source rectange of a 64x64 button | |
// create render target | |
// if I set this to the same size of the backbuffer it draws how i expect it, but for some reason | |
// changing the width/height of this is changing the look when drawn to the screen... | |
// this doesn't make sense to me because i'm only using 64x64 pixels of this big area...changing it's size | |
// shouldn't have any effect in my mind | |
Canvas = new RenderTarget2D(Graphics, 800, 600) | |
_spriteBatch.Begin(SpriteSortMode.Immediate) | |
Graphics.SetRenderTarget(Canvas) | |
_spriteBatch.Draw(_guiTexture, new Rectangle(0,0, 64, 64), srcRectangle, Color.White); | |
Graphics.SetRenderTarget(null) | |
_spriteBatch.Draw(Canvas, Vector2.Zero, Color.White); | |
_spriteBatch.End(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment