Data Realms Fan Forums
http://45.55.195.193/

Vertical/Horizantel Scaling?
http://45.55.195.193/viewtopic.php?f=73&t=17317
Page 1 of 2

Author:  CaveCricket48 [ Tue Dec 08, 2009 2:34 am ]
Post subject:  Vertical/Horizantel Scaling?

Is there a property/function to scale an object verticlly or horizantally, or stretching the object's object in a specified direction//amount?

Author:  TheLastBanana [ Tue Dec 08, 2009 2:37 am ]
Post subject:  Re: Vertical/Horizantel Scaling?

MovableObject.Scale is the only variable for scaling, but it scales both vertically and horizontally at the same time.

Author:  CaveCricket48 [ Tue Dec 08, 2009 3:00 am ]
Post subject:  Re: Vertical/Horizantel Scaling?

That won't work for me. Too bad Scale.X doesn't do anything.

Author:  TheLastBanana [ Tue Dec 08, 2009 3:11 am ]
Post subject:  Re: Vertical/Horizantel Scaling?

What kind of object is this that you're scaling?

Author:  CaveCricket48 [ Tue Dec 08, 2009 4:14 am ]
Post subject:  Re: Vertical/Horizantel Scaling?

I want to make a one-pixel sprite into a variable-length rope. I can make a sprite that gets larger every X frames by Y pixels, but the would take a while. Also spawning multiple small lines to from a single rope may cause a slight performance decrease.

Author:  411570N3 [ Tue Dec 08, 2009 4:20 am ]
Post subject:  Re: Vertical/Horizantel Scaling?

Would making an extremely long line and scaling down work? It might automatically render at least one pixel height no matter what, which would work great. Alternatively you figure out at what scale one pixel height isn't rendered, and make multiple long lines which scale to one pixel length and have them as your rope.

Author:  Kyred [ Tue Dec 08, 2009 4:32 am ]
Post subject:  Re: Vertical/Horizantel Scaling?

CaveCricket48 wrote:
I want to make a one-pixel sprite into a variable-length rope. I can make a sprite that gets larger every X frames by Y pixels, but the would take a while. Also spawning multiple small lines to from a single rope may cause a slight performance decrease.
I recommend biting the bullet and drawing out the frames. It'll take like 20 minutes tops for long rope lengths.

Author:  Geti [ Tue Dec 08, 2009 1:14 pm ]
Post subject:  Re: Vertical/Horizantel Scaling?

Or, you could draw the line with mopixels.

Author:  Roon3 [ Tue Dec 08, 2009 3:30 pm ]
Post subject:  Re: Vertical/Horizantel Scaling?

Kyred wrote:
I recommend biting the bullet and drawing out the frames. It'll take like 20 minutes tops for long rope lengths.

Did this with the Grapple gun, it doesn't look that well, nor is it worth the time. Draw with 5-10 pixel long MOSRs, you don't much lag from that.

Author:  CaveCricket48 [ Wed Dec 09, 2009 12:57 am ]
Post subject:  Re: Vertical/Horizantel Scaling?

Roon3 wrote:
Kyred wrote:
I recommend biting the bullet and drawing out the frames. It'll take like 20 minutes tops for long rope lengths.

Did this with the Grapple gun, it doesn't look that well, nor is it worth the time. Draw with 5-10 pixel long MOSRs, you don't much lag from that.

I guess I'm doing this.

I have another question: Let's say you have

Code:
daanswer = thingamabob[i]*doohickey[i]


Will the [i]'s match to the same number and "daanswer" be thingamabob^2?

Author:  TheLastBanana [ Wed Dec 09, 2009 2:23 am ]
Post subject:  Re: Vertical/Horizantel Scaling?

I'm not sure what you mean by that.
The [i] refers to which entry in the array you're accessing is. You can't really perform math operations on an array, just its values, so there is no such thing as "thingamabob ^ 2".

Author:  CaveCricket48 [ Wed Dec 09, 2009 2:28 am ]
Post subject:  Re: Vertical/Horizantel Scaling?

Let's say exampleA[1] is the number value 5, and exampleB[1] is also 5. If I multiply those values with "for i = 1, answer = exampleA[i]*exampleB[i]", will answer be 25?

Author:  411570N3 [ Wed Dec 09, 2009 2:36 am ]
Post subject:  Re: Vertical/Horizantel Scaling?

I'd think so.

Author:  CaveCricket48 [ Wed Dec 09, 2009 2:41 am ]
Post subject:  Re: Vertical/Horizantel Scaling?

If I remove the "i = 1" would exampleA[1] automaticly match with exampleB[1] and exampleA[2] automaticly match with exampleB[2]? Or would it crash or give an error?

Author:  TheLastBanana [ Wed Dec 09, 2009 2:48 am ]
Post subject:  Re: Vertical/Horizantel Scaling?

I don't think you're understanding how this works. "For" is a type of loop. I is just a variable.
If you want to print all the values in the list exampleA, for instance, you would do
Code:
for i=1,#exampleA do
   print(exampleA[i]);
end

If you just want to know what the first values of exampleA and exampleB are multiplied together, you would do
Code:
answer = exampleA[1] * exampleB[1];

Page 1 of 2 All times are UTC [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/