1
\$\begingroup\$

Problem: It seems like the Draw() call allows us to use either Destination Rectangle for resizing (5of8) or Scale (6of8/7of8) but not both.

Purpose: I would like to resize a button from 567x634 to 400x480 and then using scale to further reduce it by 0.8 to 320x400.

\$\endgroup\$
  • \$\begingroup\$ Why would you want to resize a texture twice? Personally I think the Texture uploaded should have a different size itself. \$\endgroup\$ – Steven Dec 6 '19 at 7:33
  • \$\begingroup\$ Can you elaborate on what is the difference when you say "resize" a texture, and "scale" it? Also I'm not sure I understand what you mean when you say (5of8). I'm not sure if that's something specific to XNA. Could you maybe provide more details? \$\endgroup\$ – TomTsagk Dec 6 '19 at 14:57
  • \$\begingroup\$ @TomTsagk: It's just XNA's Draw calls. There is a total of 8 ways fill in the parameters for SpriteBatch.Draw(). Once you loaded in the texture, there is a draw call that takes into account the destination (that can be resized), and then there's a draw call that can scale it down to 0.9, 0.8... from the original size. But you can't do both. \$\endgroup\$ – spirits Dec 6 '19 at 19:07
  • \$\begingroup\$ @Steven So that we can be more sloppy with the image file resolution. The second time I scale down is just to feel like a button pressed down. I suppose there is no easy inherent way to resize and scale via monogame, and that I had to take it to photoshop and make a couple of extra png files? \$\endgroup\$ – spirits Dec 6 '19 at 19:12
  • \$\begingroup\$ the overload 8of8 does have all of them - you just have to add "scale: 0.5f" as parameter. And you can also just scale the rectangle on your own before sendign to Draw \$\endgroup\$ – reiti.net Dec 7 '19 at 17:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.