Skinnable Speedometer
![](https://docs.incari.com/~gitbook/image?url=https%3A%2F%2F2561100106-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252Ff6JZovzOqBctA4C1o76u%252Fuploads%252Fgit-blob-9a40f202d1d6457f66567d16cdd0ffa2ef3747b2%252Fgreenmodern.png%3Falt%3Dmedia&width=768&dpr=4&quality=100&sign=dbab6398&sv=1)
Overview
This Demo Project consists of a speedometer whose visual presentation can be altered while maintaining the functionality. Thus, it showcases Incari's ability to alter and reuse Assets in order to fully customize the User Interface.
Themes
![](https://docs.incari.com/~gitbook/image?url=https%3A%2F%2F2561100106-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252Ff6JZovzOqBctA4C1o76u%252Fuploads%252Fgit-blob-c7d256e04556a06b729987b2c88cf22403ee2505%252Fbluetheme.png%3Falt%3Dmedia&width=768&dpr=4&quality=100&sign=2708c777&sv=1)
![](https://docs.incari.com/~gitbook/image?url=https%3A%2F%2F2561100106-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252Ff6JZovzOqBctA4C1o76u%252Fuploads%252Fgit-blob-371473649b06ddce55fbeedbfc62732c63167eba%252Fgreentheme.png%3Falt%3Dmedia&width=768&dpr=4&quality=100&sign=bebee9f3&sv=1)
The primary distinction between these two speedometers lies in their color themes. While one speedometer goes for a cool blue color palette, the other adopts a vibrant green one. The choice of colors not only affects the aesthetic appeal but can also influence the user experience. The dynamic and bold hues on one speedometer may evoke a sense of urgency or excitement, whereas the softer tones on the alternative speedometer might convey a calm and composed atmosphere. Ultimately, the difference in color serves as a visual cue that can subtly shape the driver's perception and behavior on the road.
Views
![](https://docs.incari.com/~gitbook/image?url=https%3A%2F%2F2561100106-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252Ff6JZovzOqBctA4C1o76u%252Fuploads%252Fgit-blob-c7d256e04556a06b729987b2c88cf22403ee2505%252Fbluetheme.png%3Falt%3Dmedia&width=768&dpr=4&quality=100&sign=2708c777&sv=1)
![](https://docs.incari.com/~gitbook/image?url=https%3A%2F%2F2561100106-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252Ff6JZovzOqBctA4C1o76u%252Fuploads%252Fgit-blob-f456680a8f22dd7af02c33ffd30099bf6e64d66e%252Fbluemodern.png%3Falt%3Dmedia&width=768&dpr=4&quality=100&sign=f8c36b9b&sv=1)
The disparity between two speedometers lies in their distinct styles, or view. One speedometer relies on a soft, round, classic display design. In contrast, the other speedometer embraces clean lines, digital displays, and a modern aesthetic. The choice of style not only reflects aesthetic preferences but also impacts the overall feel and atmosphere within the vehicle. The modern view may appeal to those seeking a high-tech and futuristic driving experience, while the classic view caters to enthusiasts who appreciate a simple and relaxed ambiance in their vehicle's instrumentation. The difference in style thus contributes to a diverse range of visual preferences and driving aesthetics among users.
Instructions
![](https://docs.incari.com/~gitbook/image?url=https%3A%2F%2F2561100106-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252Ff6JZovzOqBctA4C1o76u%252Fuploads%252Fgit-blob-7d659cdfbef9efc7d10321b6d62e0990f9435ddd%252Finstructions.png%3Falt%3Dmedia&width=768&dpr=4&quality=100&sign=e1246721&sv=1)
Although all four speedometer types look visually different, their functionality remains the same and can be managed by the same instructions.
↑
indicates going up in gear.↓
indicates going down in gear.O
simulates the oil temperature change.←
commands the left indicator.H
controls the hazard lights.V
changes the speedometer view.W
causes acceleration (this is only available in drive and reverse).S
brakes.F
simulates the fuel level change.→
commands the right indicator.T
changes the speedometer's theme color.
Logic
The Logic for switching the speedometer's theme and view is described below:
Switching Theme
![](https://docs.incari.com/~gitbook/image?url=https%3A%2F%2F2561100106-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252Ff6JZovzOqBctA4C1o76u%252Fuploads%252Fgit-blob-5301e0b72dd9976be7d6438a24d5f26d84ae9ad5%252Fcontrolthemeimage.png%3Falt%3Dmedia&width=768&dpr=4&quality=100&sign=4970cd59&sv=1)
Once the user presses T
, the currentColorIndex
is incremented and the Logic checks that the index is within the bounds of theme_arr-str_colors
(which is an Array that allows the user to store as many colors as they wish). This way, the number of colors can be altered dynamically and an infinite amount of color themes can be added. It is also possible to add primary, secondary, tertiary, and quaternary colors associated with that theme name to their respective arrays. These arrays, as can be seen in the Logic, are used for storing the specific color choices for different themes and can be modified as needed.
If this current index is less than the length of the Array of Strings given at the start, this means that there is a next value in the Array of themes and it continues to this next one and selects that data. However, if it is not less than the length, this means all the values of the Array have been cycled through and it starts at the 'beginning' with an index of 0. This is stored as the theme_int_currentColorIndex
.
Whenever there is a change, this triggers On theme_int_currentColorIndex Change
, which sets and returns the String value at the specified index.
![](https://docs.incari.com/~gitbook/image?url=https%3A%2F%2F2561100106-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252Ff6JZovzOqBctA4C1o76u%252Fuploads%252Fgit-blob-5327c62a8b98721a1ac6662579041fad9b29f4c2%252Fthemeupdate1.png%3Falt%3Dmedia&width=768&dpr=4&quality=100&sign=d179b23b&sv=1)
When theme_int_currentColor
changes, it triggers the four blocks of Logic in the Theme Update
grouping. These apply to the four shades of the theme's color. In the above image, the two blocks of Logic visible set the Color values for the primary and secondary Objects of the speedometer.
![](https://docs.incari.com/~gitbook/image?url=https%3A%2F%2F2561100106-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252Ff6JZovzOqBctA4C1o76u%252Fuploads%252Fgit-blob-2603a5efdcb99e430d0c0854ab19a304f298869d%252Fthemeupdate2.png%3Falt%3Dmedia&width=768&dpr=4&quality=100&sign=4b8f84ce&sv=1)
In the above image, the two blocks of Logic visible set the Color values for the tertiary and quaternary Objects of the speedometer.
Switching View
![](https://docs.incari.com/~gitbook/image?url=https%3A%2F%2F2561100106-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252Ff6JZovzOqBctA4C1o76u%252Fuploads%252Fgit-blob-1ac6893273ead43aae90f091525e516b5da4c493%252Fcontrolviewimage.png%3Falt%3Dmedia&width=768&dpr=4&quality=100&sign=924cc63d&sv=1)
Pressing V
triggers the Toggle Node and sets a variable to either 0 or 1, and stores this value in theme_int_currentValue
to later change the theme.
![](https://docs.incari.com/~gitbook/image?url=https%3A%2F%2F2561100106-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252Ff6JZovzOqBctA4C1o76u%252Fuploads%252Fgit-blob-158eccfca8997255eb13c26f22d834b9f9a54067%252Fviewupdate3.png%3Falt%3Dmedia&width=768&dpr=4&quality=100&sign=98a7bd07&sv=1)
The first block of the View Update
Logic is triggered by the change of the theme_int_currentValue
variable. Depending on the resulting variable of either 0 or 1, it provokes use of the FadeTo Node between the current and changed view. Furthermore, Objects for speed and time are being reused between different views by simple move and scale actions with the MoveTo Action Node and ScaleToAction Node, allowing the user to create specific transitions between different views without duplicating Objects.
![](https://docs.incari.com/~gitbook/image?url=https%3A%2F%2F2561100106-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252Ff6JZovzOqBctA4C1o76u%252Fuploads%252Fgit-blob-e1143ddf34d5beb029492e9e3309f070fd298836%252Fviewupdate4.png%3Falt%3Dmedia&width=768&dpr=4&quality=100&sign=2619b80e&sv=1)
The next block of Logic takes the values of the variables for acceleration, time, etc. and updates the view. This Logic shown above continues in the image below.
![](https://docs.incari.com/~gitbook/image?url=https%3A%2F%2F2561100106-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252Ff6JZovzOqBctA4C1o76u%252Fuploads%252Fgit-blob-bbb2304376784d10b12614a10ed3b9bf3c7ca75c%252Fviewupdate5.png%3Falt%3Dmedia&width=768&dpr=4&quality=100&sign=23d86be9&sv=1)
Last updated