MADRIX Forum • MAS script effect and GUI controls
Page 1 of 1

MAS script effect and GUI controls

Posted: Mon Nov 08, 2010 9:35 pm
by dieter
Hi,

I have test script with gui controls.
I use the examples from the MADRIX documentation.
It's easy to make this.

My problem.
If I scale MADRIX to fullsize then some GUI control are not scale.
What can I do?

my sample script from documenation

Code: Select all

ctrlcolor col = {"Color",AQUA};
ctrlslider chgB = {"Fade", 0, 5, 150, "The value used to dim the lines"};

void InitEffect()
{}

void RenderEffect()
{
    color chg = {-chgB.value,-chgB.value,-chgB.value,-chgB.value,-chgB.value};
    ChangeBrightness(chg);
    float f = frandom();
    DrawVectorLine(col.value, f, 0.0, f, 1.0);
}
dieter

Re: MAS script effect and GUI controls

Posted: Mon Nov 15, 2010 12:21 pm
by Wissmann
Ok this happens if the effect gui is visible and you change MADRIX to fullscreen for example. If you switch to the effect GUI after MADRIX was resized it should work.
.
So unfortunately i have to say currently there is nothing you can do, as like as switch the layer or effect and back, it is a bug :(

Re: MAS script effect and GUI controls

Posted: Thu Nov 18, 2010 12:47 am
by dieter
Hi,

no problem, with your work flow it is running.


But I have an another question.
If I use MAS-script with text edit field the different align type has none effect.

my sample:

Code: Select all

ctrledit edit1 = {"label1", EDIT_ALIGN_CENTER, "text1 center","tooltip1"};
 ctrledit edit2 = {"label2", EDIT_ALIGN_LEFT, "text2 left","tooltip2"};
 ctrledit edit3 = {"label3", EDIT_ALIGN_RIGHT, "text3 right","tooltip3"};
Can you help me?

Re: MAS script effect and GUI controls

Posted: Thu Nov 18, 2010 2:56 am
by dieter
Hi,

sorry I have a second problem.
.
I will write a script for fast call different text sequences for output.
That's why I use 12 buttons with text in script. The problem only 10 button are running, but button K and button L in my script don't running.

Code: Select all

@scriptname="fast text";
@author="dieter";
@version="";
@description="";

ctrledit editText = {"Text", EDIT_ALIGN_CENTER, "press button A...L", "tooltip t1"};
ctrlbutton3 btnType1= {"A","OnA","B","OnB","C","OnC","tooltip A","tooltip B","tooltip C"};
ctrlbutton3 btnType2= {"D","OnD","E","OnE","F","OnF","tooltip D","tooltip E","tooltip F"};
ctrlbutton3 btnType3= {"G","OnG","H","OnH","I","OnI","tooltip G","tooltip H","tooltip I"};
ctrlbutton3 btnType4= {"J","OnJ","K","OnK","L","OnL","tooltip J","tooltip K","tooltip L"};

color col=WHITE;

void InitEffect()
{
}

void RenderEffect()
{
}

void MatrixSizeChanged()
{
	InitEffect();
}

void OnA(){editText.value="A";}
void OnB(){editText.value="B";}
void OnC(){editText.value="C";}
void OnD(){editText.value="D";}
void OnE(){editText.value="E";}
void OnF(){editText.value="F";}
void OnG(){editText.value="G";}
void OnH(){editText.value="H";}
void OnI(){editText.value="I";}
void OnJ(){editText.value="J";}
void OnK(){editText.value="K";}
void OnL(){editText.value="L";}

Can help me?

Re: MAS script effect and GUI controls

Posted: Thu Nov 18, 2010 9:55 am
by Wissmann
dear dieter,
.
under win xp and win 7 we can not reproduce the behavior you describe regarding the edit controls. What kind of operation system you use? Which MADRIX version?
.
Regarding the Button Controls i have to say you are the best tester ;-) and sorry you found a bug. Within the script we provide currently up to 20 button controls ( 0 - 19 ) but unfortunately because of a small bug only 10 working currently. We will fix this of course immediately for the next release 2.10a in December.

Re: MAS script effect and GUI controls

Posted: Mon Nov 29, 2010 7:42 am
by dieter
I work with win xp and win2k the problem the same, no align. My friend have a notebook with dual boot win xp and vista. There I testing MADRIX. Don't align in xp but in vista align available. I think it is not a problem of hardware.

The buttons not really a problem in my script need only 4 button :-) only my script of test need more for better understanding and learning the language.

I have another problem or question.
I wrote a script in ticker effect to view a counter for the next new year party.
The problem: I ever will see this counter.
I found 2 ways to make this.
1. All place have a layer with this effect. The problem its not easy to copy and fit this layer for all places.
2. I use the script in main view. The problem is the function

Code: Select all

SetText()
from ticker effect isn't available.

Do you have ideas for better way or make simply my problems?

Re: MAS script effect and GUI controls

Posted: Mon Nov 29, 2010 10:16 am
by Wissmann
Hi dieter,
.
about this i have to think about 2min.

Re: MAS script effect and GUI controls

Posted: Sun Dec 12, 2010 4:12 pm
by dieter
Hi,
2 minutes right and 2 day's ok and 2 weeks ok but 2 months too late

Re: MAS script effect and GUI controls

Posted: Mon Dec 13, 2010 11:23 am
by Pinzer
Hi dieter,

Another idea couldt be to use the ReadAsync() function. With that you can read the text out from a file. So you can edit the text with an text editor and all places can read the same file so you have on all places the same text.

Re: MAS script effect and GUI controls

Posted: Mon Dec 13, 2010 12:37 pm
by Wissmann
Sorry Dieter i lost this task, i am just to busy.
.
I think currently you only can do two things.
1.) Each Effect one Ticker Layer with a Macro
2.) Draw the Text manual with the Main Out Macro (I mean SetPixel and DrawLine a.s.o.)

The second option is muxh more work but the better solution in my mind.