Hi guys
I have a concern I would like to make a drop-down menu that will display the list of country indicators. I have a JSON file with all the indicators, their flags and names of each country, I was able to make the dropdown menu and I would like to display the data contained in the JSON file in my dropdown menu.
Here is my .JSON file
Here is my file in JS where I create the selection in my dropdown menu
Thank you in advance please help me
linrm
June 1, 2022, 2:23am
#2
linrm
June 1, 2022, 9:15am
#3
Could you show your demo, and show the final result you want?
In a logic that I would like to make a drop-down menu to display and make a choice on the countries for the player, here it is
I would like to display the information contained in the JSON file in the Dropdown Menu
linrm
June 2, 2022, 9:23am
#6
You can refer to document i metioned before to get JSON data from JSON file , then to set data to the Dropdown Menu.
Hi, CocosCreator 3.5.0 already supports importing json in ts. You can do what I did by using.
can I do that in Cocos Creator 2.4.5? I’ve tried it, but in the console showing error message “Cannot find module”
system
closed
June 7, 2022, 4:27am
#9
This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.