Hi, i try to dev an UI. In this UI there is drag and drop, eveyrthink work when i try out the game, but in game the target to drop doesnt work. I have my focus SetNuiFocus(true true), i can move my item but not drop it. If someone can know why please.
In fact i believe thats mousehover is’nt detected in game when i have my left click
Hey, I’m pretty sure you are using HTML5, and FiveM Client actually doesn’t support it. You should make “Mouse Listeners” to handle it, so like, an state with coords and update it every time mouse is dragged and the div at coords from that “state”. You can look up on this library which I just forked just to have an idea.
@0rangeFox Hi, thanks for you answer, you’e right i didn’t know that fivem doesn’t use html5. I’m really begginer in dev so i try to use your library but i don’t know how to import it. I really try to search on internet but i don’t get it.
When i try :
<script type="module">
import {DragDropContainer, DropTarget} from "./react-drag-drop-container-typescript"
</script>
I have an error:
Failed to load module script: Expected a JavaScript module script but the server responded with a MIME type of "text/html". Strict MIME type checking is enforced for module scripts per HTML spec
If you can help me more precisely with where put import instruction etc… it will be great. Thanks
You’re welcome, sorry but I forgot to mention, that’s a library for React, I mentioned it, just for you check at code how you can achieve it into pure JS without frameworks.
Oh ok, i see, thanks a lot. But i think it’s well too high for my level^^ I don’t understand at all that code. Thanks to take time to help me
You’re welcome and happy coding!