c# - Modify readonly members in a class -
i learning monogame these days , there class called "texture2d" has 2 readonly members width , height. take values actual graphic used. there way can change values width , height of texture changes (either deriving or other way)? , if derive it, how obtain object content.load() method?
you don't need change width/height of source texture.
use spritebatch.draw
method destination rectangle.
void draw(spritebatch spritebatch) { spritebatch.begin(); spritebatch.draw(texture, new rectangle(100, 100, 200, 200), color.white); spritebatch.end(); }
take @ other overloads scale , rotation.
Comments
Post a Comment