Skip to main content

Advanced Cluster Part 3

• In the “Custom_Gauge”, add new “StackLayout” and name it “StackLayout_Texts”

• Add 2 “Text” controls and 1 “Text Value” control to the “StackLayout_Texts”, rename the text controls to “Text_Top” and “Text_Bottom”

drawing-7-1676524979.png

• Ensure that the order of the items inside of this layout is the same as shown in the picture above.

• Set these parameters: Arrangement = Vertical, MinimumSize = 250, VerticalAlignment = VCenter

drawing-7-1676524999.png

• Set these “Text_Top” values: VerticalAlignment = VCenter, HorizontalAlignment = HCenter, Text Alignment = Center, Text Style = OpenSans35, Text = “RPM”

• Same for the “Text_Bottom” values, but set Text = “” (to be empty)

• Almost the same for the “Text_Value”, with these differences: Format Text = “%04d”, Text Style = Vera96

drawing-7-1676525320.png
drawing-7-1676525330.png
drawing-7-1676525340.png

• Select the “StackLayout_Texts” and add 2 Value behaviors (Toolbox->Behaviors->Value Processing->Value). Name them as “Value_TextPos_X” and “Value_TextPos_Y”

drawing-7-1676525394.png

 

grafik.png

• To each of these behaviors, insert 1 “Set Position” behavior (Behaviors->Value Processing->Transformation->Set Position) as Receiver. Name them “Set Position_X” and “Set Position_Y”

grafik.png

• For both of them, set the target node Custom_Gauge->StackLayout_Texts. Select the proper axis (X for Set Position_X, Y for Set Position_Y)

• For the “Value_TextPos_X” behavior set the Receiver property Variant= (Float) 205 and for the “Value_TextPos_Y” behavior, configure Variant = (Float) 230. 

• Click at the “Custom_Gauge” control and put “Forward Value” behavior into it

• Set its target node to “Custom_Gauge->StackLayout_Texts->TextValue”

grafik.png

• Go to the “Custom_Gauge”, click on the “ControlValueProvider” behavior and set the Receivers Maximum value to 8000. Then try to change its Variant value so you can see the text and needle updated.

• Right-click at the “Custom_Gauge” and select “Control Properties…”. We will choose which properties should be available from the scene as the control properties

• Follow the settings from the pictures below:

ForegroundImage:
drawing-7-1676525492.png

BackgroundImage:

drawing-7-1676525560.png

NeedleImage:

drawing-7-1676525593.png

NeedleEffectImage:

drawing-7-1676525629.png

Text_Bottom:

drawing-7-1676525656.png

Text_Top:

drawing-7-1676525680.png

Text_Value:

drawing-7-1676525703.png

Value_TextPosX and Value_TextPosY:

drawing-7-1676525724.png

• The custom gauge control should now be finished and ready to use