Use TouchGFX to make a Rubik's Cube (Day 5) I have mastered control arrays and transparency, but I still have a hard time grasping the scroll bar. Last time I mentioned control arrays. It is true that they cannot be achieved by dragging the interface, but they can be written in the code. Add array definition to Screen1view.hpp410358 and use it directly in Screen1view.cpp. If you define it directly in Screen1view.cpp, you will be prompted 410359 during simulation, but it can still be executed. I don't know what will happen if it is burned in. I think I have a good chance of getting one in this event, so you can try it. The stacking order of the added pictures is determined by the execution order of the add statement, and the ones added later are on top. 410360 In order to make room for the 3d animation, I put this block in the upper left corner. In addition, the scroll bar control is mentioned. I don't know how to use the scroll bar events. If I drag the scroll bar directly, it seems that "slider adjustment confirmed", "slider adjustment initiated", "slider value changed" will not be triggered. The reason is unknown. . . So I added two buttons to control addition and subtraction.
Considering the continuity of the value, 15 is used as the value for addition and subtraction. By adding and subtracting, I set the alpha value (transparency) of the left, front and top surfaces. I found a small bug: If I use the dragging method to change the value of the slider, the increase function will be invalid in some value ranges (30, 60), add print debugging information The result is really strange Only 30 and 60 are abnormal. . . Okay, I will continue to study, The code to achieve the effect of a push button switch The effect is This content is created by EEWORLD forum user tobot. If you need to reprint or use it for commercial purposes, you must obtain the author's consent and indicate the source
|