Character resize function

Started by Masked Guardian, Thu 05/03/2009 22:58:24

Previous topic - Next topic

Masked Guardian

I've 3.1.2 SP1 version.

I supposed there isn't any resize character resize function, is there? :(

My problem is: I've created a character who is almost big as the room (640 x 480). I've imported many frames for a nice animation and it would be really boring to do all the process again (resizing, converting avi to bmp files e.t.c.)

No, i don't want to use the Manual scalling and Character.Scaling property, 'cause i intend to use this character to an area where i need an automatic room scaling.

The problem can be partially overcomed by adjusting the walkable area's scaling levels (eg from 10 up to 50) but that doesn't help in case i have to to resize another moving supporting character at the same time.

I think it would be very handy a character.resize function, with this it would be as i've imported the frames to the desired size (plus the quality will be better since the actual sprite images are high-res!)

Joe

You can set the walkable area to the proper scaling percent in the walkable area properties list. ;)
Copinstar © Oficial Site

Trent R

#2
There was a recent topic about this, but Scaling is the only way to go I believe. A character.resize would be very low priority since there's other ways to solve your problem (besides, you're being lazy and it'd be better in the long run to do it other ways.)

Few ideas: 1) Right click your sprites, 'Copy sprite to clipboard' then paste into your favorite program. Resize, Ctr-A, Ctrl-C, right click your sprite again, 'Replace sprite from clipboard'

2) Not sure (cause I don't use scaling) but can't you get the Scaling of the walkable area the character is currently on? You could then use this in conjunction with character.Scaling (I think this is what was done in the other thread)


[Edit]: The recent thread I mentioned, http://www.adventuregamestudio.co.uk/yabb/index.php?topic=36553.0. Khris has a cool code in there too, and Gilbot links an old module that he wrote. Both would be good resources.
Also, the command I was thinking of is GetScalingAt



~Trent
To give back to the AGS community, I can get you free, full versions of commercial software. Recently, Paint Shop Pro X, and eXPert PDF Pro 6. Please PM me for details.


Current Project: The Wanderer
On Hold: Hero of the Rune

Masked Guardian

#3
Ok, first of all thanks for your advices :)


I quote myself: "The problem can be partially overcomed by adjusting the walkable area's scaling levels (eg from 10 up to 50) but that doesn't help in case i have to to resize another moving supporting character at the same time."

Trent, if you have imported 120 frames then it will surely be a headache to resize each one of them and then re-import ;) But even if you use a program that resize at the same time many images, still the problem of quality remains if the scaling level of walkable area enlarges the character.

Anyway, thanks for the link, i think it will be useful :D

SSH

I've just created a module that can resize the sprites of a character's views on the fly. I think this would be what you want. It does various other "distortions" too, and is the DistortChar module. I'll make a new thread for the module up soon...
12

Masked Guardian

SSH your module looks really great, i will give it a try :) Congrats for your effort :D

For now i think KhrisMUC's code covers me for what i want to do (but i will use your module for more advanced things ;) ):

Code: ags
function Scale(this Character*, float factor) {
  if (this.Room != player.Room) return;
  if (!this.ManualScaling) this.ManualScaling = true;
  int s = FloatToInt(IntToFloat(GetScalingAt(this.x, this.y)) * factor);
  if (s<1) s = 1;
  if (s>200) s = 200;
  this.Scaling = s;
}


And to think that i had in my mind a similar code, but i stuck cause i wasn't aware about extender functions (it could be done without extender but it's a bit frustrated i think). AGS is really flexible!

Trent R

Without an extender function, you could still use either an int (along with the character[] array) or a pointer.
Code: ags
function Scale (Character* toScale, float factor)
function Scale (int charID, float factor)



~Trent
To give back to the AGS community, I can get you free, full versions of commercial software. Recently, Paint Shop Pro X, and eXPert PDF Pro 6. Please PM me for details.


Current Project: The Wanderer
On Hold: Hero of the Rune

Joe

Anyway the extender function is nice, Trent, I think it would be good for your pseudo-module  :P wouldn't?
Copinstar © Oficial Site

Trent R

Yeah, and I'm just pointing out that there are other ways to do it. Sometimes, it won't work with an extender.


~Trent
To give back to the AGS community, I can get you free, full versions of commercial software. Recently, Paint Shop Pro X, and eXPert PDF Pro 6. Please PM me for details.


Current Project: The Wanderer
On Hold: Hero of the Rune

SMF spam blocked by CleanTalk