1 Attachment(s)
Customising the look of FuseGL
This thread is very much a Work in Progress. I'm no programmer, so this should explain how to change the visual appearance of FuseGL for other non-coders.
To make any changes to FuseGL's visual appearance, you'll be modifying is UserGUIConfig.xml, located in the Config folder of your FuseGL installation. You want to open this file with Notepad or similar text editor. As with anything, save a backup file somewhere safe in case you make a terrible mistake.
1: Changing a Sensor - Size and Location
If you've followed previous threads (http://www.mp3car.com/fb-documentati...-progress.html) then you'll already know how to add a basic Sensor to FuseGL to display readings. Here is a basic example, a Thermosensor, to get us started:
Attachment 67813
If we look at the UserGUIConfig file, this is what we'll see:
Code:
<?xml version="1.0" encoding="utf-8"?>
<FuseGL_User_Settings>
<Persistant_Variables>
<variable name="autoVariable___[Sensor - Temperature in Celcius[0,1] - TEMP 1]" first_value="0.0" type="double" />
</Persistant_Variables>
<User_Object type="FuseGL_Object">
<setting type="string" name="GL - LBL - Sensor - Temperature in Celcius[0,1] - TEMP 1" />
<image location="internal" path="FuseGL.Configurator.Configurator_IMG_Resources.UserButtonBackground" />
<text text="(action){FuseGL.ExecuteCode(UpdateLabelText.cs;FuseGL_TextManipulation.InternalFlyCompile_UpdateLabelText;ChangeButtonTextOnVariablePersistant;{$[*].autoVariable___[Sensor - Temperature in Celcius[0,1] - TEMP 1]};{this};0.000;°C;)}" />
<size width="180" height="135" />
<location x="495" y="60" z="0" alignment="L" />
<setting type="int" border_size="1" />
<setting type="bool" mouse_cursor_to_hand_on_hover="false" />
<events>
<startup action="FuseGL.ExecuteCode" inputArgs="Sensors.cs;FuseGL_Sensors.Sensors;Initialize___TempSensor___Celcius;{FB.AnalogueInput(0.1)};{$[*].autoVariable___[Sensor - Temperature in Celcius[0,1] - TEMP 1]};" outputTo="this.text.text" />
</events>
</User_Object>
</FuseGL_User_Settings>
We have a Persistent Variable, which is the sensor itself. Then we have a User Object, which is the on-screen display of that sensor, and which also includes an Event, determining how the User Object changes according to the Persistent Variable. The object is displayed in a basic format determined by FuseGL.
But it's possible to change the Object from within the Config file. For starters, have a look at this part of the code:
Code:
<size width="180" height="135" />
<location x="495" y="60" z="0" alignment="L" />
This determines the size and location of your Sensor on the screen. Width and Height are obvious, and if you built your Sensor with FuseGL's drag and drop interface, you'll see that the numbers are divisible by 15 - the standard square of FuseGL's Configurator grid. The x and y variables locate the Sensor's top-left pixel, relative to the top-left of the screen, and again these are divisible by 15. But they don't have to be. If you want to redraw, resize or relocate your Sensor, just change these numbers, save the Config file and reload FuseGL.