GithubHelp home page GithubHelp logo

ihyajb / fivem-blip-info Goto Github PK

View Code? Open in Web Editor NEW

This project forked from glitchdetector/fivem-blip-info

1.0 0.0 1.0 14 KB

This resource aims to help implement the pop-up information window that appears when hovering over blips in GTA Online. It also serves as an example use of the newly discovered tech it's built upon.

License: MIT License

Lua 100.00%

fivem-blip-info's Introduction

FiveM Blip Info Utility

by glitchdetector

This resource aims to help implement the pop-up information window that appears when hovering over blips in GTA Online. It also serves as an example use of the newly discovered tech it's built upon.

This popup is only visible while in the pause menu map, and while hovering over a blip that has information attached to it.

All rendering and logic is handled by the resource.

This resource is a standalone utility, meaning:

  • It does not rely on a framework
  • It does nothing by itself
  • You as a developer need to utilize its exports
  • If you are not a resource developer, this is not for you

Screenshots

Setup

Set blip_info as a depencendy in your resource

Usage

All functions are available via exports

Info is set per blip (handle) and only need to be set once.

ResetBlipInfo(blip)

Removes all blip info and no longer shows info popup when selected

SetBlipInfoTitle(blip, title, rockstarVerified)

Sets the info popup title and the state of the R* verified icon

SetBlipInfoImage(blip, dict, tex)

Sets the header image for the info popup

SetBlipInfoEconomy(blip, rp, money)

Changes the visual representation for RP and Money in the popup, empty strings disable the respective icon

AddBlipInfoText(blip, leftText, rightText)

Adds a line to the info popup

AddBlipInfoName(blip, leftText, rightText)

Adds a line to the info popup, rightText appearing in bold

AddBlipInfoHeader(blip, leftText, rightText)

Adds a line to the info popup, including a separator between this and the previous line

AddBlipInfoIcon(blip, leftText, rightText, iconId, iconColor, checked)

Adds a line to the info popup, including a blip icon.

iconId can range from 0 to 30 (ish, some seems to just be misssing / get skipped).

image image

iconColor appears to match with blip colors.

SetBlipInfo(blip, infoData)

Sets the raw info data, for advanced use

Example

This example code is what produced the result in the screenshot earlier

exports['blip_info']:SetBlipInfoTitle(blip, "Sample Title", true)
exports['blip_info']:SetBlipInfoEconomy(blip, "1 200", "12.85M")
exports['blip_info']:AddBlipInfoText(blip, "Info Text", "Sample Text")
exports['blip_info']:AddBlipInfoName(blip, "Info Name", "glitchdetector")
exports['blip_info']:AddBlipInfoHeader(blip, "Info Header", "Look a line")
exports['blip_info']:AddBlipInfoIcon(blip, "Info Blip", "wew", 16, 0, true)

License

Do what you want, except:

  • Re-distribute a non-remixed version of this resource outside of the target platform

fivem-blip-info's People

Contributors

glitchdetector avatar ihyajb avatar

Stargazers

 avatar

Forkers

jimathy

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.