PDA

View Full Version : SpriteScalePP question


royter
10-28-2009, 11:27 PM
i am trying to give random size to my sprites particles but when i add the SpriteScaleYPP and Sprite ScaleXPP with the expression:
particleShape1.spriteScaleXPP=rand(0.25,1);
particleShape1.spriteScaleYPP=rand(0.25,1)

it works but the 2 are independant, i need the sprties to have different size but always a 1:1 ratio, so i need those 2 attributes to change together.

stooch
10-28-2009, 11:30 PM
i am trying to give random size to my sprites particles but when i add the SpriteScaleYPP and Sprite ScaleXPP with the expression:
particleShape1.spriteScaleXPP=rand(0.25,1);
particleShape1.spriteScaleYPP=rand(0.25,1)

it works but the 2 are independant, i need the sprties to have different size but always a 1:1 ratio, so i need those 2 attributes to change together.

$randSize = rand(0.25,1);
spriteScaleXPP=$randSize;
spriteScaleYPP=$randSize;

or

spriteScaleXPP=rand(0.25,1);
spriteScaleYPP=spriteScaleXPP;

(you dont need to type out the item name in expression editor, it just assumes that you mean the currently selected parent)

Aikiman
10-28-2009, 11:39 PM
or...

spriteScaleXPP=spriteScaleYPP=rand(.25,1);

all the same just different way of doing it.

royter
10-28-2009, 11:43 PM
thanks alot guys, it works!

CGTalk Moderation
10-28-2009, 11:43 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.