How can i make panels darker or brighter?

Posted By: Progger

How can i make panels darker or brighter? - 08/29/10 17:24

Hi my question is how can i make panels darker is there a function for this?
WFG Progger
Posted By: TrackingKeks

Re: How can i make panels darker or brighter? - 08/29/10 17:40

Perhaps you could try
-bmap_to_alpha (BMAP*, var percent);
-pan_setcolor(PANEL*, var type, var num, COLOR*);

or:
Use gimp grin
Posted By: Progger

Re: How can i make panels darker or brighter? - 08/29/10 17:41

thank you ill try it
WFG Progger
Posted By: MasterQ32

Re: How can i make panels darker or brighter? - 08/29/10 17:42

i think the flag LIGHT will do the stuff, because you can color you panels with it
so you set the color to 128,128,128 there will be no change, but at 64,64,64 it will be darker
Posted By: Aku_Aku

Re: How can i make panels darker or brighter? - 08/29/10 18:02

I think pan_setcolor used for setg the color of text on panels...
Posted By: Progger

Re: How can i make panels darker or brighter? - 08/29/10 18:46

Ok thanks for ur help i decided to use a sprite because it didnt work with the Panel
Posted By: bodden

Re: How can i make panels darker or brighter? - 08/30/10 09:41

I tried Richi's way by setting LIGHT and red/blue/green. Works fine for all panel-elements. You can make the panel brighter by pressing "1" or darker by pressing "2".

Code:
BMAP* panel_png = "a7Cube.png"; 
var vred;
var vblue;
var vgreen;

PANEL* yourPanel =
{
	digits(300,0,"red: %.0f",*,1,vred); 
 	digits(300,20,"blue: %.0f",*,1,vblue);
	digits(300,40,"green: %.0f",*,1,vgreen);
	
	bmap = panel_png;
  	flags = SHOW;
}

function main()
{
	level_load("");
	set(yourPanel,LIGHT);
	
	vec_set(yourPanel.blue,vector(128,128,128));
	
			
	while(1)
	{
	
		if (key_1)
		{		
			yourPanel.blue=clamp(yourPanel.blue+5*time_step,0,255);
			yourPanel.red=clamp(yourPanel.red+5*time_step,0,255);
			yourPanel.green=clamp(yourPanel.green+5*time_step,0,255);
		}
		
		if (key_2)
		{		
			yourPanel.blue=clamp(yourPanel.blue-5*time_step,0,255);
			yourPanel.red=clamp(yourPanel.red-5*time_step,0,255);
			yourPanel.green=clamp(yourPanel.green-5*time_step,0,255);
		}
			
		vred=yourPanel.red;
		vblue=yourPanel.blue;
		vgreen=yourPanel.green;
		
		wait(1);
		
	}
}


Posted By: Progger

Re: How can i make panels darker or brighter? - 08/30/10 13:25

Thank you for this example bodden laugh
WFG Progger
© 2024 lite-C Forums