PDA

View Full Version : colours


bluegel
02-21-2003, 04:35 PM
does anyone know how to change colours in a game.

I have a game where I can select objects and change the way that they behave. they appear on a screen which is a boundaryBox. I want the user to be able to change the colour of the boundary box as well, to green, red, purple (checkboxes have been created for the selection of colours), once the game has been played.

any suggestions?

thanx in advance

:p

Ricod
02-21-2003, 06:05 PM
Hi ! This is Robert Penners code :

// Penner Prototype
MovieClip.prototype.setColorTransform = function (trans) {
(new Color(this)).setTransform (trans);
};
colorTransform = new Object();
roffset=256;
goffset=256;
boffset=256;
rv=1;
gv=1;
bv=1;
mov_box.onEnterFrame=function(){
roffset+=rv;
goffset+=gv;
boffset+=bv;
colorTransform.ra = 100;
colorTransform.rb = 100*(Math.sin(Math.PI/180*roffset));
colorTransform.ga = 100;
colorTransform.gb = 100*(Math.sin(Math.PI/180*goffset));
colorTransform.ba = 100;
colorTransform.bb = 100*(Math.sin(Math.PI/180*boffset));
colorTransform.aa = 100;
colorTransform.ab = 0;
this.setColorTransform(colorTransform);
};

bluegel
02-24-2003, 08:50 AM
thanx.

I'll try that.

:p

Ricod
02-24-2003, 12:29 PM
np ! :D It's not mine anyway ! :p

bluegel
02-24-2003, 03:33 PM
i used some of the code and managed to get it to work.

thanx :D

Ricod
02-25-2003, 07:29 AM
Good to hear ! :)