Get the latest tech news

Drag and Drop Images into Bevy 0.15 on the web


Rustunit offers software development consulting with a focus on rust, game-development and large scale distributed backend services.

You can find the full function here but the important part is that the code is essentially 1:1 from how you would solve this in vanilla javascript translated to rust while looking at the web_sys docs for reference. Note that we are setting the drop_effect and effect_allowed here to make sure the browser will allow us to receive the drop and to show this on the mouse cursor to the user as well. We are using the FileReader API to read the binary data and some metadata from the file and then forward it to Bevy via send_event.

Get the Android app

Or read this on Hacker News

Read more on:

Photo of Web

Web

Photo of drag

drag

Photo of Drop Images

Drop Images

Related news:

News photo

Google Unveils Project Mariner: AI Agents To Use the Web For You

News photo

Google unveils Project Mariner: AI agents to use the web for you

News photo

Show HN: Piazza, syncing the web in a vectorized DB