[29 Nov 2009] (Designer) is it possible to use code to decide some layers position at start?

Contains all messages from the Hollywood mailing list between 01/2006 and 08/2012
Locked
Bugala
Posts: 1390
Joined: Sun Feb 14, 2010 7:11 pm

[29 Nov 2009] (Designer) is it possible to use code to decide some layers position at start?

Post by Bugala »

Note: This is an archived post that was originally sent to the Hollywood mailing list on Sun, 29 Nov 2009 07:49:17 -0000

Three questions actually in total.

1:

I made this volume slider with designer that when i click it moves it on X to the place where mouse pointer at that moment is.

Now the idea is that if your volume is say at 50 percent, then when you come to that Page that slider would be in correct place already, in this case, at middle of slider.

I also have some options like "Continue" game option. If there is no saved game existing, it of vcourse whouldnt display that text at all.

So question is wether i can put at some place some code simply in way of:

Code: Select all

If VariableX=0 Then ShowLayer(ID,x,y)
ElseIf Variable X=1 Then something else...
2:

Second question is regarding the same slider.

Now problem is that there is this option "When Clicked" but it reacts only to ONE click, not to continuous Click (mouse button kept down).

In this case it means that everytime i move that slider, i need to click. And that means that moving it to 100 percent you need to click at right spot.

It would much more comfortable if you could just hold your mouse button down and drag it to where ever you want it.

Is there way to have "While Mouse Button Down" option in Designer?

If there isnt now, then you should add one for the next version of Designer.

3:

When i make Custom Code and i want it to go to some other page, what command should i use then?

I mean. say when you click on button comes code:

Code: Select all

If VariableX=0 Then Goto Page "Main Menu"
So how do i do this?

Is it simply Goto "place in code"

and if so, then how do i know what is the name of that place in code, or is it maybe the name of the page?
User avatar
airsoftsoftwair
Posts: 5834
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

[01 Dec 2009] Re: (Designer) is it possible to use code to decide some layers position at start?

Post by airsoftsoftwair »

Note: This is an archived post that was originally sent to the Hollywood mailing list on Tue, 01 Dec 2009 23:40:20 +0100
Three questions actually in total.

1:

I made this volume slider with designer that when i click it moves it on X to the place where mouse pointer at that moment is.

Now the idea is that if your volume is say at 50 percent, then when you come to that Page that slider would be in correct place already, in this case, at middle of slider.

I also have some options like "Continue" game option. If there is no saved game existing, it of vcourse whouldnt display that text at all.

So question is wether i can put at some place some code simply in way of:

Code: Select all

If VariableX=0 Then ShowLayer(ID,x,y)
ElseIf Variable X=1 Then something else...
2:

Second question is regarding the same slider.

Now problem is that there is this option "When Clicked" but it reacts only to ONE click, not to continuous Click (mouse button kept down).

In this case it means that everytime i move that slider, i need to click. And that means that moving it to 100 percent you need to click at right spot.

It would much more comfortable if you could just hold your mouse button down and drag it to where ever you want it.

Is there way to have "While Mouse Button Down" option in Designer?

If there isnt now, then you should add one for the next version of Designer.
Well, I'd suggest you use Hollywood directly for both 1) and 2). Fiddling this stuff into Designer might be possible but personally I'd feel much more comfortable to do this directly in Hollywood. It just gives you much greater control and flexibility.
3:

When i make Custom Code and i want it to go to some other page, what command should i use then?

I mean. say when you click on button comes code:

Code: Select all

If VariableX=0 Then Goto Page "Main Menu"
So how do i do this?

Is it simply Goto "place in code"

and if so, then how do i know what is the name of that place in code, or is it maybe the name of the page?
That's possible using a special code sequence. You need to give your page a UID and then use %>PAGEID in your code. Check the Designer manual for more precise info.
Locked