Okay, the idea is this, when you click on an object it calls a function and generates different results based on the ID of the object.
IN THIS CASE, I have 10 buttons (all objects) on screen, when you click it, a different object briefly becomes transparent. (i.e. Click on Object[10] and Object[0] briefly appears.)
Is there a more elegant way to do this - presumably using EXTENDER FUNCTIONS - or am I reduced
function Syn (short value) {
object[value].TweenTransparency(0.5, 0, eEaseInTween, eBlockTween);
object[value].TweenTransparency(0.5, 100, eEaseOutTween, eBlockTween);
}
function oBut0_AnyClick() //Object 10;
{
Syn(0);
}
function oBut1_AnyClick() //Object 11;
{
Syn(1);
}
//et cetera...
- Cogliostro
You can override on_mouse_click() in room scripts so something like this should work. ClaimEvent() will prevent any other script files from receiving the click event.
function on_mouse_click(MouseButton button)
{
if(button == eMouseLeft)
{
Object* pObj = Object.GetAtScreenXY(mouse.x, mouse.y);,
if(pObj != null)
{
Syn(pObj.ID);
ClaimEvent();
}
}
}
JSH -
It worked like a charm, thanks!
- Cogliostro