Skip to content
This repository has been archived by the owner on Jan 4, 2023. It is now read-only.

make a sprite running on links #5

Open
pyweeker opened this issue Feb 23, 2022 · 2 comments
Open

make a sprite running on links #5

pyweeker opened this issue Feb 23, 2022 · 2 comments
Labels
enhancement New feature or request

Comments

@pyweeker
Copy link

Hello, shaders are not supported yet, but i'd like to add this kind of sprite, following the tracks where energy is running as a symbol of electrons ; dont know how to implement it, but could be easy fast good looking effect

https://cdn2.vectorstock.com/i/1000x1000/25/41/electrical-burst-ball-lightning-realistic-vector-22372541.jpg

i can look after a png for background transparent alpha , with free copyright.

@r4gus
Copy link
Owner

r4gus commented Feb 23, 2022

I had something similar implemented. You can find the code in src/gate/graphics/connection_line.rs.

There is a function (system) called draw_data_flow that checks for DataPoints and moves them along a bezier curve (the associated connection line).

The function draw_line_system redraws all connection lines each frame, this is something that I need to change for obvious reasons. I also used that function to draw the dots representing the data/ energy flow.

You could reuse the DataPoint component and add your sprite(s) as child/ children. Then you would need a new system that iterates over all ConnectionLine components and spawns a new DataPoint for each in a fixed time interval (look at the bottom of draw_line_system for some inspiration - maybe you can just use the commented code).

Also make sure to add the draw_data_flow system in src/gate.rs.

I personally found it a little bit distracting but maybe you can come up with a decent visualization :). If you've further questions, feel free to ask.

@r4gus r4gus added the enhancement New feature or request label Feb 23, 2022
@pyweeker
Copy link
Author

pyweeker commented Feb 23, 2022 via email

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants