# Get the Current Mouse position while you hold the left mouse button # Return Nothing because we need to return something.Įlif Input.is_action_pressed("left_mouse_button"): If Input.is_action_just_pressed("left_mouse_button"): # Remember to create the left mouse click input!! It returns the amount you moved the mouse from the initial click to the drag of the mouse. After you have those, you can probably find a way to use them but I used the code below to add them together and use them as one. If they are inside, show them.ĥ - Create a new input for left mouse button, (So that we can get is actionjust pressed and isaction_pressed for the mouse button)Ħ - Get mouse distance in between a click, I did this by setting an old mouse position on-click and setting a newclick position using the is actionjust pressed for the oldmouse and is actionpressed for new_mouse. I will call this node $MapIcons for future reference.Ĥ - If your sprites position is outside the map, hide them. We will use a for loop to get all that nodes children and move them as a unit. Also, add the duplicate sprites to their own node. We will show them in step 4)ģ - Duplicate the image to your hearts content using for loops. This will be the map.Ģ - Put a sprite of whatever you want on the map in the same scene (We will duplicate it to create more elements on the map so hide it for now. I, wildly over-exaggerated the issue and didn't consider it a normal mini map with mouse movement but for the people who want to know what I did.ġ - Create a base image, preferably a grid but you do you. I messed around with it and found an answer.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |