• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!

[C# XNA] Negative Scale?

Status
Not open for further replies.

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,202
Use GIMP and resize the image to the size you want to use it at. If you want the size to be dynamic (not determinable before execution) then you may want to use a graphic plugin that supports float positions and scales.

Personally I think it does support scale by that nice scale parameter that GhostWolf so kindly showed us.
 

Chaosy

Tutorial Reviewer
Level 40
Joined
Jun 9, 2011
Messages
13,183
How about the 4 seconds that it takes to do a google search? http://msdn.microsoft.com/en-us/library/ff433988.aspx

I did search ofc. Thanks for the link. However I dont know what to put in some fields.
JASS:
spritebatch.Draw(button, new Vector2(20,400), null, null?, color.White, ???, ???, 0,2f, None, 0f)
//I think this is somewhat right, but as you see I dont know a few fields.

Use GIMP and resize the image to the size you want to use it at. If you want the size to be dynamic (not determinable before execution) then you may want to use a graphic plugin that supports float positions and scales.

Personally I think it does support scale by that nice scale parameter that GhostWolf so kindly showed us.

I tried this first. I edited with paint since there is a simple rescale function there. Sadly when I open with paint it removes the transperant background and replaces it with white background. I changed the chroma key to 255,255,255 but it still didnt remove it. Therefore I thought it would be easier to scale the image with code.

EDIT: I downloaded another editing program to fix it. Thanks anyway. rep +

EDIT 2: I could not rep you two more atm :p
 
Last edited:

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,202
spritebatch.Draw(button, new Vector2(20,400), null, null?, color.White, ???, ???, 0,2f, None, 0f)
//I think this is somewhat right, but as you see I dont know a few fields.
Try
Code:
spritebatch.Draw(button, new Vector2(20,400), null, color.White, 0f, null, 0.2f, null, 0f)
You really should learn to read what they have written in the API. Remember the number of arguments have to match the number of arguments declared by the interface.
 
Last edited:

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,202
0,9f is not a good idea to use. US compilers will interpret it as 2 parameters (as US/UK use '.' as their decimal delimiter unlike Germany and places which use ','). This will result in a compiler error as you are passing too many parameters to the function.

Basically the program has no way to distinguish between 0,9f being 0.9f (float constant) or 0 and 9f, 2 parameters of integer 0 and float 9.
 
Status
Not open for further replies.
Top