How to achieve UI interaction?

foreword

The UI display has been realized before. This article supplements the realization of the interactive function of the UI. First, draw the mind map. The self-cultivation of the programmer is to clarify the thinking at any time. Clear thinking is the premise of coding, as shown below:
UI interactive brain map
here In fact, there is no implementation of double-clicking the mouse to use/equip items, because there is no character interface, so this function cannot be implemented. Of course, with the implementation cases of the above three interaction methods, it is not difficult to expand.

0 trade items

When both the store interface and the backpack interface are open, when we click the item in the backpack with the left mouse button, it will be understood that we want to sell the item. How is the function of this trading item realized?
First, we need to monitor the UI event of the item being clicked. Each item is actually a button Button, and we can dynamically bind the click event of the button. At the same time ࿰

Guess you like

Origin blog.csdn.net/qq_30137245/article/details/130927963