Smart Tags

Beyond user input fields, meta tags can also retrieve data from the SignalRGB API. These are known as meters, distinct from the Meter class discussed in the Snippets section. There are four types of visual meters available: linear, area, ocr_textmatch, and ocr_numeric.

Additionally, the API offers seven Content Properties: audio level, audio width, audio density, audio frequency, zone hue, zone saturation, and zone lightness.

Meters

All meters share four core attributes:

AttributesDescription
MeterDefines the variable name, accessible via engine.vision.meter, where meter is your chosen name.
TypeSpecifies the meter type: linear, area, ocr_textmatch, or ocr_numeric
XX-coordinate, in normalized form. The meter is drawn from its top-left corner.
YY-coordinate, in normalized form.

Normalized Coordinates

X and Y coordinates, along with height and width, must be entered as normalized values. For example, if I’m playing a game at 1920x1080 resolution and want to place a small meter roughly halfway down on the left side of the screen, I determine the origin (top-left corner) of the meter to be 50 pixels from the left and 500 pixels down from the top-left corner of the screen.

This gives me:

x = 50, y = 500.

To convert these to normalized coordinates, I divide x by the screen width (1920) and y by the screen height (1080), which results (rounded and in the correct format) in:

x = ".026", y = ".463"

Although this conversion should theoretically allow a meter to work for any resolution with a 16:9 aspect ratio, many games experience small UI changes between resolutions. How to format meters for different resolutions will be covered in the troubleshooting section at the bottom of this page.

Linear Meter

A linear meter returns the percentage of pixels along a horizontal line that match a specified HSL range, with a value from 0.0 to 1.0. For example, a linear meter covering the full width of a green health bar would return a value of 0.5 at half health.

Linear
Copy

Linear meters require four additional attributes:

AttributeDescription
WidthThe width value, expressed in normalized form
HThe HSL hue component, ranging from 0 to 360
SThe HSL saturation component, from 0% to 100%
LThe HSL lightness component, from 0% to 100%

Area Meter

An area meter returns the percentage of pixels within a rectangular region that fall within a specified HSL range, with values from 0.0 to 1.0. This type of meter can be used to detect larger UI elements such as textboxes or minimap zones.

Area
Copy

Area meters require five additional attributes:

AttributeDescription
WidthThe width value, expressed in normalized form
HeightThe height value, expressed in normalized form
HThe HSL hue component, ranging from 0 to 360
SThe HSL saturation component, from 0% to 100%
LThe HSL lightness component, from 0% to 100%

OCR Text Match Meter

This meter uses Optical Character Recognition (OCR) to look for a specific string within a defined rectangular area on the screen. If the string is found, it returns 1; if not found, it returns 0; and if unsure, it returns -1.

OCR Text Match
Copy

OCR text match meters require four additional attributes:

AttributeDescription
WidthThe width, in normalized form.
HeightThe height, in normalized form.
StringThe string to look for. Case-sensitive.
ConfidenceA value from 0-100 that specifies how sure the meter should be about a match. Defaults to 70 if not specified.

OCR Numeric Meter

This meter uses Optical Character Recognition (OCR) to detect numeric values within a rectangular area on the screen. If successful, it returns the number as an integer; if it fails, it returns -1.

OCR Numeric
Copy

OCR numeric meters require three additional attributes:

AttributeDescription
WidthThe width, in normalized form.
HeightThe height, in normalized form.
ConfidenceA value from 0-100 that specifies how sure the meter should be about a match. Defaults to 70 if not specified.

Content Properties

Content properties are higher-density meters that come directly from the API.

Audio Properties

  • engine.audio.level returns the current audio level in decibels.
  • engine.audio.width gives the perceived stereo width of the incoming audio, as a ratio from 0 to 1.
  • engine.audio.density provides the frequency density of the incoming audio, also as a ratio from 0 to 1 - white noise produces values near 1.0, while pure tones return values closer to 0.
  • engine.audio.freq returns an array with 200 elements, each representing the current level of a specific frequency band.

Screen Properties

  • engine.zone.hue returns an array of 560 elements, each representing the hue value of a point on the screen. These points are sampled from a 28 x 20 grid.
  • engine.zone.saturation returns an array of 560 elements, each representing the saturation at a screen point, sampled from the same 28 x 20 grid.
  • engine.zone.lightness returns an array of 560 elements, each indicating the lightness value at a screen point, also sampled from the 28 x 20 grid.

Troubleshooting

When writing code, problems can occur. Below are some common issues with meters and how to fix them:

  • “My meter or user control doesn’t show up in the app”

    • Try fully closing and restarting the application. If the issue persists, the meter may be incorrectly formatted. Double-check spelling and punctuation.
  • “The app or LightScript keeps crashing”

    • This is often caused by a malformed meter. Missing or extra attributes can crash the app or the code. If your meters are correct, look for issues like infinite loops or undeclared variables.
  • “My meter appears but doesn’t track the right area of the screen”

    • The normalized coordinates may be incorrect. Remember: it's x / screen width, y / screen height. If math isn't your strong suit, try increasing the meter’s width or height to help identify the correct screen area. Just keep in mind that rectangular meters will look vertically squashed in the inspector.
  • “My meter works on one resolution, but not on others”

    • Fortunately, you won’t need multiple meters for dynamic UI. See below for an example of a linear meter adapted for multiple resolutions.
Resolution Adjustment
Copy

As you can see, I've specifically adjusted the meter for 3840x2160 and 2560x1080 resolutions. All other resolutions will default to the original meter.

  • “My meter is correctly placed but does not trigger

    • As a LightScript developer, this will be a common issue. Area and linear meters can be finicky on gradients or transparent UI. Open up an HSL slider (like this one) and observe your screen until the colors match. Start with wide ranges in hue, saturation, and lightness until the meter consistently triggers, then narrow it down. For OCR meters, ensure that the whole word or number you’re targeting is included in the meter, with as little additional content as possible. There is a limit to the text size or screen resolution on which OCR meters will work. Placing an OCR meter on a large “VICTORY” text filling a 1920x1080 screen? No problem. But try it on a chatbox at 1280x720 and you’ll see limited results. Also, high contrast between text and background is ideal for OCR – white text on a white background will not be read.
  • "My meter triggers too rapidly or all the time"

    • Congratulations, your meter works, but triggering three times a second probably isn’t what you want. Transparent UI, colorful environments, explosions, and even cutscenes can cause false or rapid activation of your meters. This will always be a challenge. One simple workaround is to use the Meter class, as outlined in the next section, Snippets.
Type to search, ESC to discard
Type to search, ESC to discard
Type to search, ESC to discard