View unanswered posts | View active topics It is currently Sat Dec 28, 2024 12:48 am



Reply to topic  [ 18 posts ]  Go to page 1, 2  Next
 Vertical/Horizantel Scaling? 
Author Message
User avatar

Joined: Tue Jun 12, 2007 11:52 pm
Posts: 13144
Location: Here
Reply with quote
Post 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
Profile
DRL Developer
DRL Developer
User avatar

Joined: Wed Dec 13, 2006 5:27 am
Posts: 3138
Location: A little south and a lot west of Moscow
Reply with quote
Post 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
Profile WWW
User avatar

Joined: Tue Jun 12, 2007 11:52 pm
Posts: 13144
Location: Here
Reply with quote
Post 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
Profile
DRL Developer
DRL Developer
User avatar

Joined: Wed Dec 13, 2006 5:27 am
Posts: 3138
Location: A little south and a lot west of Moscow
Reply with quote
Post Re: Vertical/Horizantel Scaling?
What kind of object is this that you're scaling?


Tue Dec 08, 2009 3:11 am
Profile WWW
User avatar

Joined: Tue Jun 12, 2007 11:52 pm
Posts: 13144
Location: Here
Reply with quote
Post 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
Profile
User avatar

Joined: Wed Jan 07, 2009 10:26 am
Posts: 4074
Location: That quaint little British colony down south
Reply with quote
Post 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
Profile WWW
User avatar

Joined: Sun May 31, 2009 1:04 am
Posts: 308
Reply with quote
Post 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
Profile
User avatar

Joined: Sun Jul 13, 2008 9:57 am
Posts: 4886
Location: some compy
Reply with quote
Post Re: Vertical/Horizantel Scaling?
Or, you could draw the line with mopixels.


Tue Dec 08, 2009 1:14 pm
Profile WWW
User avatar

Joined: Sun May 11, 2008 12:50 pm
Posts: 899
Reply with quote
Post 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
Profile WWW
User avatar

Joined: Tue Jun 12, 2007 11:52 pm
Posts: 13144
Location: Here
Reply with quote
Post 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
Profile
DRL Developer
DRL Developer
User avatar

Joined: Wed Dec 13, 2006 5:27 am
Posts: 3138
Location: A little south and a lot west of Moscow
Reply with quote
Post 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
Profile WWW
User avatar

Joined: Tue Jun 12, 2007 11:52 pm
Posts: 13144
Location: Here
Reply with quote
Post 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
Profile
User avatar

Joined: Wed Jan 07, 2009 10:26 am
Posts: 4074
Location: That quaint little British colony down south
Reply with quote
Post Re: Vertical/Horizantel Scaling?
I'd think so.


Wed Dec 09, 2009 2:36 am
Profile WWW
User avatar

Joined: Tue Jun 12, 2007 11:52 pm
Posts: 13144
Location: Here
Reply with quote
Post 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
Profile
DRL Developer
DRL Developer
User avatar

Joined: Wed Dec 13, 2006 5:27 am
Posts: 3138
Location: A little south and a lot west of Moscow
Reply with quote
Post 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
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 18 posts ]  Go to page 1, 2  Next

Who is online

Users browsing this forum: No registered users


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.
[ Time : 0.027s | 15 Queries | GZIP : Off ]