Timeline for Monogame/XNA - How do you resize a Texture2D and then scale it?
Current License: CC BY-SA 4.0
10 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Mar 9, 2020 at 18:02 | history | bumped | CommunityBot | This question has answers that may be good or bad; the system has marked it active so that they can be reviewed. | |
Feb 8, 2020 at 14:06 | answer | added | will_m | timeline score: 1 | |
Dec 8, 2019 at 21:27 | comment | added | reiti.net | @spirit 8of8 should be the versino with the optional parameters (the non-optional one is deprecated I think). Have you considered, that you aso can have a transform Matrix in the Begin() Method for global scaling? PS? With scaling the Rectangle I ment the DestinationRectangle itself, not the texture image | |
Dec 8, 2019 at 19:05 | comment | added | spirits | @reiti.net I believe 8of8 has been deprecated and removed from functioning in Monogame. Still shows up though as an option. When I try it, the game crashes. Yeah, seems like photoshop is the only way left. Still, they should have kept the draw call as it would achieve purposes 1-7 couldn't. | |
Dec 7, 2019 at 17:38 | comment | added | reiti.net | 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 | |
Dec 6, 2019 at 19:12 | comment | added | spirits | @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? | |
Dec 6, 2019 at 19:07 | comment | added | spirits | @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. | |
Dec 6, 2019 at 14:57 | comment | added | Tom Tsagkatos |
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?
|
|
Dec 6, 2019 at 7:33 | comment | added | Steven | Why would you want to resize a texture twice? Personally I think the Texture uploaded should have a different size itself. | |
Dec 6, 2019 at 2:55 | history | asked | spirits | CC BY-SA 4.0 |