thinkaliker / dragalia-controller

Python controller for Dragalia Lost using scrcpy
MIT License
15 stars 1 forks source link

More documentation needed #1

Open abdulhakam opened 4 years ago

abdulhakam commented 4 years ago

Hi, I am trying to modify this script for another game(Honkai Impact 3) but am unable to figure out how can i position joystick but buttons can be set something like this (something like using screen aspect ratio): (new position buttonx) = ((screen resolution x) / (position of button x)) (new screen resolution x) (new position buttony) = ((screen resolution y) / (position of button y)) (new screen resolution y)

x and y are axis here not the button names plus not all of the buttons are defined in the script and i am having difficulty in understanding button names.

thinkaliker commented 4 years ago

Hi - yes, I do need to revisit this script at some point (not a lot of free time at the moment). Once I have some time I'll go through and add comments, clean up variable names, and maybe come up with a better way of mapping controls to your screen - using screen ratios is a pretty good idea.

abdulhakam commented 4 years ago

thanks i will be waiting.

thinkaliker commented 4 years ago

@abdulhakam I've just made an update which scales each button position according to the window position and size, rather than hardcoding the positions. I know this doesn't totally answer your question but I am considering abstracting this script out to a much larger effort, where you're able to place the joysticks and buttons where you want, in any display, for any game. But that will come much later.

I think for your situation, the important thing to change are the ratios inside of the game_buttons dictionary. Also take a look at compute_all which can lock scaling to each corner, so if the window is resized, the "corner" buttons stay in the "corner"

mohamedSalehHegazy commented 8 months ago

Deleted for spam