Author |
Message |
CaveCricket48
Joined: Tue Jun 12, 2007 11:52 pm Posts: 13144 Location: Here
|
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?
|
Tue Dec 08, 2009 2:34 am |
|
|
TheLastBanana
DRL Developer
Joined: Wed Dec 13, 2006 5:27 am Posts: 3138 Location: A little south and a lot west of Moscow
|
Re: Vertical/Horizantel Scaling?
MovableObject.Scale is the only variable for scaling, but it scales both vertically and horizontally at the same time.
|
Tue Dec 08, 2009 2:37 am |
|
|
CaveCricket48
Joined: Tue Jun 12, 2007 11:52 pm Posts: 13144 Location: Here
|
Re: Vertical/Horizantel Scaling?
That won't work for me. Too bad Scale.X doesn't do anything.
|
Tue Dec 08, 2009 3:00 am |
|
|
TheLastBanana
DRL Developer
Joined: Wed Dec 13, 2006 5:27 am Posts: 3138 Location: A little south and a lot west of Moscow
|
Re: Vertical/Horizantel Scaling?
What kind of object is this that you're scaling?
|
Tue Dec 08, 2009 3:11 am |
|
|
CaveCricket48
Joined: Tue Jun 12, 2007 11:52 pm Posts: 13144 Location: Here
|
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.
|
Tue Dec 08, 2009 4:14 am |
|
|
411570N3
Joined: Wed Jan 07, 2009 10:26 am Posts: 4074 Location: That quaint little British colony down south
|
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.
|
Tue Dec 08, 2009 4:20 am |
|
|
Kyred
Joined: Sun May 31, 2009 1:04 am Posts: 308
|
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.
|
Tue Dec 08, 2009 4:32 am |
|
|
Geti
Joined: Sun Jul 13, 2008 9:57 am Posts: 4886 Location: some compy
|
Re: Vertical/Horizantel Scaling?
Or, you could draw the line with mopixels.
|
Tue Dec 08, 2009 1:14 pm |
|
|
Roon3
Joined: Sun May 11, 2008 12:50 pm Posts: 899
|
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.
|
Tue Dec 08, 2009 3:30 pm |
|
|
CaveCricket48
Joined: Tue Jun 12, 2007 11:52 pm Posts: 13144 Location: Here
|
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?
|
Wed Dec 09, 2009 12:57 am |
|
|
TheLastBanana
DRL Developer
Joined: Wed Dec 13, 2006 5:27 am Posts: 3138 Location: A little south and a lot west of Moscow
|
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".
|
Wed Dec 09, 2009 2:23 am |
|
|
CaveCricket48
Joined: Tue Jun 12, 2007 11:52 pm Posts: 13144 Location: Here
|
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?
|
Wed Dec 09, 2009 2:28 am |
|
|
411570N3
Joined: Wed Jan 07, 2009 10:26 am Posts: 4074 Location: That quaint little British colony down south
|
Re: Vertical/Horizantel Scaling?
I'd think so.
|
Wed Dec 09, 2009 2:36 am |
|
|
CaveCricket48
Joined: Tue Jun 12, 2007 11:52 pm Posts: 13144 Location: Here
|
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?
|
Wed Dec 09, 2009 2:41 am |
|
|
TheLastBanana
DRL Developer
Joined: Wed Dec 13, 2006 5:27 am Posts: 3138 Location: A little south and a lot west of Moscow
|
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];
|
Wed Dec 09, 2009 2:48 am |
|
|
|