Coloured Buttons Please

I need to do simple coloured buttons to my rollout just like the thepupettool script. I know I can do it with images, but I only need a fast and simple way to changes solid colors. Any Idea?

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Swordslayer's picture

If you don't want to go the

If you don't want to go the dotnet way, you can just change the .images property of button or use imgtag instead and change its .bitmap property (and you don't have to deal with the #(bitmap, alpha, 1,1,1,1,1) definition and get some extra functions as a bonus). For example:

try destroyDialog test catch()
rollout test "Test" width:200
(
	progressBar pbFrame width:52 height:22 enabled:false
	imgTag itColorful bitmap:(bitmap 50 20 color:red) pos:(pbFrame.pos+[1,1]) across:2	
	colorPicker cpChangeColor "Change color:" color:red width:115 pos:[75,6]
 
	on cpChangeColor changed val do
		itColorful.bitmap = bitmap 1 1 color:val
 
	on itColorful click do
		print cpChangeColor.color
)
createDialog test

Note that I used a disabled progressbar to frame the imgtag. That was just to give it some kind of a border and is quite hacky but it works...

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.