Cursor on loading screen

Hi, how i can put mouse cursor on loading screen?

2 Likes

Some javascript:

window.onload = function() 
{
  document.body.addEventListener("mousemove", function(event)
  {
        var cursor = document.getElementById("cursor");

        //TODO: More consistent way of aligning the cursor without awkward offsets?
        var x = event.pageX - cursor.width + 7;
        var y = event.pageY - 7;

        cursor.style.left = x;
        cursor.style.top = y;
  });
}

Cursor is just an image (that gets assigned dynamically):

 <img id="cursor"/>
2 Likes

do you place the <img id=“cursor”/> inside the index.html? I am just confused as to where that goes?

where do you put all the stuff and how big does the cursor have to be? @Syntasu I found out that the script had to go in config.js but I don’t where the should go inside the index.html

With these kind of questions, I suggest you follow an html/css/js course to get familiar with it.

hey i put everything on right place and my mouse image stay stucked on left corner

here is working mouse cursor javascript and html that should work universally for any loading screen.
Live demo: https://pensionable-surveil.000webhostapp.com

follow my instructions and everything should work.

  1. Download this javascript file: https://pensionable-surveil.000webhostapp.com/cursor.js
  2. Download the cursor image I used: https://pensionable-surveil.000webhostapp.com/cursor.png
  3. Place those files inside your loading screen’s resource folder.
  4. Open the __resource.lua file and add 'cursor.png' and 'cursor.js' to the files {}
  5. Open your loading screen’s index.html file and scroll to the very bottom.
  6. Find the </body> tag then paste this code on the line above the tag.
<img id="cursor" src="cursor.png"/>
<style>
  #cursor {
  width: 35px;
  height: 35px;
  position: fixed;
  z-index: 10000;
          }
  </style>
  <script src="cursor.js"></script>
  1. Save and open the index.html in your web browser or test the loading screen on your server.
  2. Profit?

Here is a download of the whole thing if you just want easy mode, it uses ElusionPDX edited copy of this loading screen which plays youtube videos from a list you can configure.
https://pensionable-surveil.000webhostapp.com/t-loadscreen-fixed-working-mouse.zip

Update:
I enabled the player controls and now playing information.

3 Likes

Thanks man!

it does not work

I can’t click, please help

yes the link is dead

yo your links dont work

3 Likes

Put loadscreen_cursor 'yes' in your __resource.lua file.

2 Likes

perfect

Then now my esx_identity dont show her cursor xD

Thank you man, you have help me doll, thanksss <3