Jump to content
Sign in to follow this  
MrCopyright

Unable to add event handlers to RscPicture

Recommended Posts

I have been unable to add any event handlers to RscPicture controls. The base defines were created via Arma 3's GUI editor.

_ctrl = (findDisplay 700) displayCtrl 1200;
_ctrl ctrlAddEventHandler ["MouseButtonDown", "_this call fnc_test"];

I can assure you that the IDD and the IDC in the .hpp file are correct. I've never tried adding event handlers to pictures until today.

Share this post


Link to post
Share on other sites

I found the solution to the problem, use RscActivePicture instead of RscPicture.

  • Like 1

Share this post


Link to post
Share on other sites

also try ctrlEnable true on RscPicture. someone told me today that would be needed for interaction. maybe it applies here too.

Share this post


Link to post
Share on other sites

Not sure if activepicture requires an eventhandler but activeText doesn't. You can set it as a picture and it has an action variable like a button. It's how I make custom buttons for UIs. Quick example.
 

class RscAppBtnOne: RscActiveText
{
	idc = 850100;
	x = 0.11* safezoneW + safezoneX;
	y = 0.8 * safezoneH + safezoneY;
	w = 0.0375 * safezoneW;
	h = 0.05 * safezoneH;
	color[] = {1,1,1,1};
	colorActive[] = {1,1,1,0.2};
	colorDisabled[] = {1,1,1,1};
	soundEnter[] = { "", 0, 1 };   // no sound
	soundPush[] = { "", 0, 1 };
	soundClick[] = {"\A3\ui_f\data\sound\RscButton\soundClick",0.09,1};
	soundEscape[] = { "", 0, 1 };
	action = "hint ""Good choice!""";
	text= "images\playerTestLive2.paa";
	tooltip = "Player";
	default = true;
};

I also made a tutorial for custom images and buttons 

 

  • Like 1

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×