-- Object Tinting Behavior -- Author: Jeff The Intern -- Created On: 09/12/08 -- Revisions -- New Script 09/12/08 -- CONSTANTS -- Properties Define Properties() channel_1_color = {red = 255, green = 255, blue = 255, alpha = 1} ExposeProperty('channel_1_color', 'What color should the grey channel be tinted with?', 'color') channel_1_use = 0 ExposeProperty('channel_1_use', 'Grey Channel Tinting On', 'checkbox') channel_2_color = {red = 255, green = 255, blue = 255, alpha = 1} ExposeProperty('channel_2_color', 'What color should the red channel be tinted with?', 'color') channel_2_use = 0 ExposeProperty('channel_2_use', 'Red Channel Tinting On', 'checkbox') channel_3_color = {red = 255, green = 255, blue = 255, alpha = 1} ExposeProperty('channel_3_color', 'What color should the green channel be tinted with?', 'color') channel_3_use = 0 ExposeProperty('channel_3_use', 'Green Channel Tinting On', 'checkbox') channel_4_color = {red = 255, green = 255, blue = 255, alpha = 1} ExposeProperty('channel_4_color', 'What color should the blue channel be tinted with?', 'color') channel_4_use = 0 ExposeProperty('channel_4_use', 'Blue Channel Tinting On', 'checkbox') script_description = 'Tintable' script_long_description = 'Tint the sprite of this object. Only works with Greyscale Sprites.' script_icon = '12071:440' end -- Triggers Trigger param_changed(caller, user_id, script_id, param) if(script_id == scriptId) then DeleteTint(self, 'none') if(self.channel_1_use == 1) then TintSpritePartial(self, 'none', self.channel_1_color.red, self.channel_1_color.green, self.channel_1_color.blue, 'grey') end if(self.channel_2_use == 1) then TintSpritePartial(self, 'none', self.channel_2_color.red, self.channel_2_color.green, self.channel_2_color.blue, 'red') end if(self.channel_3_use == 1) then TintSpritePartial(self, 'none', self.channel_3_color.red, self.channel_3_color.green, self.channel_3_color.blue, 'green') end if(self.channel_4_use == 1) then TintSpritePartial(self, 'none', self.channel_4_color.red, self.channel_4_color.green, self.channel_4_color.blue, 'blue') end end end -- Functions