Re: Costume mods - update 30 aug. 2014 : Minato Namikaze 1.1 & Naruto Uzumaki 1.1
Ah, I have a confession. I've not actually done anything with modPages either, so I'm just as much in the dark as you. I
do actually have plans to fiddle with it for a
Prince of Persia set, but there's no telling when I'll actually get around to it.
Now, ColorTransforms I can actually help you with. In a nutshell, they are how vanilla RGB slider support gets implemented. I don't think you've done any work with vanilla RGB support, so a quick tutorial. In whatever element that you're working on (let's go with upperarmr), create two layers. The top layer will be the shading, while the bottom layer will be the fill. The fill should be solid black, and converted into a named MovieClip object, set using the properties window (vanilla uses "rgbFill"). Essentially, you should be able to refer to the fill in AS as "upperarmr.rgbFill". For vanilla, that's all that's necessary, since hooking stuff up to the sliders is all handled by SDT itself.
For the loader, you'll have to implement the backend stuff yourself. Here's some example code, taken from my Sonia gloves.
var gloves:Array;
var rgba:Array;
var trans:ColorTransform = new ColorTransform();
function initl(l) {
//...load stuff here
}
//frame listener
function frameRefresh(l) {
//handjob
handpos();
//arms:Back
// armPosition();
rgba = main.g.characterControl.topControl.getDataString().split(",");
// rgba = main.g.characterControl.armwearControl.getDataString().split(",");
gloves.forEach(followColorSlider);
}
function followColorSlider(element:*, index:Number, arr:Array) {
trans.color = (rgba[4]<<24 | rgba[1]<<16 | rgba[2]<<8 | rgba[3]);
element.rgbFill.transform.colorTransform = trans;
}
The method "followColorSlider" is an iterator function. I don't know if you've ever seen one before, but basically what's going on is that "gloves" is an array containing all the elements I want colored (eg upperarmr). For each element in "gloves" (creatively referenced as "element") the iterator function gets called.
Now, this is designed to work with the vanilla RGB sliders, which is why this stuff is being called by a frame listener, but you'll probably want to tie this to a mouse click listener instead. The "rgba" array is used to extract the vanilla RGB values, which are concatenated for generate a color value for "trans.color", but if you're not planning on using the vanilla sliders don't worry too much about it. Just keep in mind that "trans.color" should be set to a hexadecimal RGB value (eg 0xFFFFFF for white) or its decimal equivalent (eg 16777215 for white).