Custom GUI

Started by .M.M., Fri 26/10/2007 15:12:51

Previous topic - Next topic

.M.M.

What's wrong in that script???

if (interface == VLASTNOSTI) {   
    if (button == 5) {
      gVlastnosti.Visible == false ;
    }
  }

VK Dan

#1
EDIT: Actually, I see the error. Instead of

      gVlastnosti.Visible == false ;

it should be

      gVlastnosti.Visible = false ;

the == says "is it equal to?" while = says "make it equal to"

Khris

And btw, the interface_click function is obsolete now.

The way to do it now is to name the button using the "Script name" field in its properties window, set "Left click" to "RunScript", then double-click its "Click" property. This will create/take you to the function.

VK Dan

#3
Or you could do what I do...just double click the button and it will create/take you to the function. :P

EDIT: No need to quote the entire previous post.

Khris

True, but you still have to name the button and set "Left click" to "RunScript" first. :P

VK Dan

I suppose that's true in the 3.0 betas. I was thinking of AGS 2.72.

Ashen

'Left click' is the default action in 2.72, so while it DOES need to be set to that, YOU (the AGSer) don't have to do it. Unless you've set it to one of the others previously. You DO have to name the Button, though.

But that's beside the point. Mirek, if you're using 2.7 or later, you shouldn't be using interface_click. It works, but it's not good practice. If you're using an earlier version, then carry on. (Once you've made the correction VK Dan gave you.)
Also, in future, make your posts a little more descriptive - why do you think there's something wrong, what is/isn't it doing. is there an error message, etc. Not necessary here, as the problem was so obvious (and I'd guess it was a 'parse error at ... ' error message), but keep it in mind.
I know what you're thinking ... Don't think that.

.M.M.

O.K. so if I don't have to use interface_click where do I have to place my script?

Khris

Did you try this:
Quote from: KhrisMUC on Fri 26/10/2007 15:52:55The way to do it now is to name the button using the "Script name" field in its properties window, set "Left click" to "RunScript", then double-click its "Click" property. This will create/take you to the function.
?
Following these steps will create a function called ButtonName_Click(...).

In there is where your code goes.

.M.M.

Button_click is great idea! :o :o :o It´s really easy to use it!

Dualnames

Actually you could change VLAwhatevery to the number of that GUI.
Worked on Strangeland, Primordia, Hob's Barrow, The Cat Lady, Mage's Initiation, Until I Have You, Downfall, Hunie Pop, and every game in the Wadjet Eye Games catalogue (porting)

SMF spam blocked by CleanTalk