Skip to content

Instantly share code, notes, and snippets.

@wowjeeez
Last active June 23, 2023 15:38
Show Gist options
  • Save wowjeeez/4fa1df967aa017a6f2c9cca0b80889fa to your computer and use it in GitHub Desktop.
Save wowjeeez/4fa1df967aa017a6f2c9cca0b80889fa to your computer and use it in GitHub Desktop.
GTA 5 screen coords to HTML % (mainly used with FiveM nui)
function coordsToPerc(X, Y) {
const x = X * 100
const y = Y * 100
const style = `style="position:fixed; top:${this.location.y}%; left:${this.location.x}%"`
return {X: x, Y: y, CSS: style}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment