nodus icon indicating copy to clipboard operation
nodus copied to clipboard

make a sprite running on links

Open pyweeker opened this issue 2 years ago • 2 comments

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.

pyweeker avatar Feb 23 '22 10:02 pyweeker

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 avatar Feb 23 '22 11:02 r4gus

thanks !

Le mer. 23 févr. 2022 à 12:50, David Sugar @.***> a écrit :

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.

— Reply to this email directly, view it on GitHub https://github.com/r4gus/nodus/issues/5#issuecomment-1048702701, or unsubscribe https://github.com/notifications/unsubscribe-auth/ATQR4NZGBOKUIJNVF4GUOVTU4TCZHANCNFSM5PD4ULCQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you authored the thread.Message ID: @.***>

pyweeker avatar Feb 23 '22 12:02 pyweeker