Skip to content

Label Variables

Ashton edited this page Jan 6, 2025 · 2 revisions

Using RIFT, you can add variables to your CCLabelBMFonts in the text attribute. RIFT is a powerful string scripting tool (https://github.com/EclipseMenu/rift). It allows for you to run certain functions and read variables into a string.

Some examples of using a variable in a CCLabelBMFont are:

{
    "attributes": {
        "text": "MY NAME IS {toUpper(username)}!!!"
    }
}
{
    "attributes": {
        "text": "I have half these stars {stars_stat * 2}"
    }
}

Happy Textures comes with a ton of variables built in for your use in these labels. Here is a list:

  • username: Your username
  • game_version: The version of GD you are playing on
  • geode_version: The version of Geode you are using
  • previous_string: The label string before you changed it (in case you want to modify it)
  • jumps_stat: Your Total Jumps stat
  • attempts_stat: Your Total Attempts stat
  • completed_levels_stat: Your Completed Levels stat
  • completed_online_levels_stat: Your Completed Online Levels stat
  • demons_stat: Your Demons stat
  • stars_stat: Your Stars stat
  • completed_map_packs_stat: Your Completed Map Packs stat
  • gold_coins_stat: Your Gold Coins stat
  • players_destroyed_stat: Your Players Destroyed stat
  • liked_levels_stat: Your Total Liked Levels stat
  • rated_lavels_stat: Your Total Rated Levels stat
  • user_coins_stat: Your User Coins stat
  • diamonds_stat: Your Diamonds stat
  • current_orbs_stat: Your Current Orbs stat
  • completed_dailies_stat: Your Completed Daily Levels stat
  • fire_shards_stat: Your Fire Shards stat
  • ice_shards_stat: Your Ice Shards stat
  • poison_shards_stat: Your Poison Shards stat
  • shadow_shards_stat: Your Shadow Shards stat
  • lava_shards_stat: Your Lava Shards stat
  • earth_shards_stat: Your Earth Shards stat
  • blood_shards_stat: Your Blood Shards stat
  • metal_shards_stat: Your Metal Shards stat
  • light_shards_stat: Your Light Shards stat
  • soul_shards_stat: Your Soul Shards stat
  • demon_keys_stat: Your Demon Keys stat
  • total_orbs_stat: Your Total Orbs stat
  • moons_stat: Your Moons stat
  • diamond_shards_stat: Your Diamond Shards stat
  • completed_gauntlets_stat: Your Completed Gauntlets stat
  • collected_list_rewards_stat: Your Collected List Rewards stat

The next variables require you to be within a level, either info, playing, or editing:

  • level_creator: The creator of the level
  • level_name: The name of the level
  • level_description: The description of the level
  • level_id: The ID of the level
  • level_normal_percent: The percent you have in normal mode on the level
  • level_practice_percent: The percent you have in practice mode on the level
  • level_attempts: The attempts you have on the level
  • level_attempt_time: The attempt time you have on the level
  • level_best_time: The best time you have on the level
  • level_jumps: The total jumps you have on the level
  • level_password: The level password
  • level_stars: The level stars/moons
  • level_length_value: The level length in number form

The next variables require you to be playing a level:

  • playlayer_percent: Your current Traditional Percent
  • playlayer_is_platformer: True if in a platformer level

More PlayLayer variables are planned in the future

The next variables require you to be searching for a level

  • level_search_type: The type of search you are making:
    • Search = 0,
    • Downloaded = 1,
    • MostLiked = 2,
    • Trending = 3,
    • Recent = 4,
    • UsersLevels = 5,
    • Featured = 6,
    • Magic = 7,
    • Sends = 8,
    • MapPack = 9,
    • MapPackOnClick = 10,
    • Awarded = 11,
    • Followed = 12,
    • Friends = 13,
    • Users = 14,
    • LikedGDW = 15,
    • HallOfFame = 16,
    • FeaturedGDW = 17,
    • Similar = 18,
    • Type19 = 19,
    • TopListsUnused = 20,
    • DailySafe = 21,
    • WeeklySafe = 22,
    • EventSafe = 23,
    • Reported = 24,
    • LevelListsOnClick = 25,
    • Type26 = 26,
    • Sent = 27,
    • FeaturedLite = 28,
    • Bonus = 29,
    • MyLevels = 98,
    • SavedLevels = 99,
    • FavouriteLevels = 100,
    • SmartTemplates = 101,
    • MyLists = 102,
    • FavouriteLists = 103
  • level_search_mode: The mode of search you are making: 0 for Traditional, 1 for Platformer

The following variables are only used in node conditionals:

  • node_position_x: The X position of a node
  • node_position_y: The Y position of a node
  • node_scale: The scale of a node
  • node_scale_x: The X scale of a node
  • node_scale_y: The Y scale of a node
  • node_anchor_x: The X anchor of a node
  • node_anchor_y: The Y anchor of a node
  • node_ignore_anchor_pos: If a node ignores the anchor point for position
  • node_content_size_width: The content width of a node
  • node_content_size_height: The content height of a node
  • node_visibility: The visibility of a node
  • node_rotation: The rotation of a node
  • node_rotation_x: The X rotation of a node
  • node_rotation_y: The Y rotation of a node
  • node_skew_x: The X skew of a node
  • node_skew_y: The Y skew of a node
  • node_z_order: The Z order of a node
  • node_parent_id: The parent ID of a node
  • node_font: The font of a CCLabelBMFont
  • node_text: The text of a CCLabelBMFont
  • node_sprite: The sprite of a CCSprite
  • node_color: The color of a node
  • node_opacity: The opacity of a node
  • window_size_width: The width of the whole window
  • window_size_height: The height of the whole window

Clone this wiki locally