{"__v":17,"_id":"550a4d06492cbf0d00bbff79","category":{"__v":7,"_id":"550a4c2e42fff40d00ae6049","project":"543b9b0065bf840e00b473d5","version":"543b9b0065bf840e00b473d8","pages":["550a4d06492cbf0d00bbff79","550a870cb6fd572500a57a42","550d801711e8d00d00b80380","551e00f5a7e98017009e3ee4","551edb36c2d1ec1700b4261c","554f09c6a8c1ae0d00c5bb93","55b63d63f8105a2f00c34e33"],"reference":false,"createdAt":"2015-03-19T04:10:22.740Z","from_sync":false,"order":3,"slug":"units","title":"Units"},"project":"543b9b0065bf840e00b473d5","user":"543b9aa865bf840e00b473d1","version":{"__v":11,"_id":"543b9b0065bf840e00b473d8","project":"543b9b0065bf840e00b473d5","createdAt":"2014-10-13T09:27:28.467Z","releaseDate":"2014-10-13T09:27:28.467Z","categories":["543b9b0065bf840e00b473d9","543b9ef065bf840e00b473e0","54890012f291f61400c02d36","54890902f291f61400c02d3e","54890c43f291f61400c02d44","54890d71c178b40b00aa3086","5508125c0c4d8c19008a5f83","55094050961f17170070abbd","550945111c38c50d006118ad","550a4c2e42fff40d00ae6049","55221c074801a40d00a77610"],"is_hidden":false,"is_beta":false,"is_stable":false,"codename":"","version_clean":"1.0.0","version":"1.0"},"updates":[],"createdAt":"2015-03-19T04:13:58.420Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"order":1,"body":"[block:callout]\n{\n  \"type\": \"success\",\n  \"title\": \"Only Pro and Complete Kits Have Instantiated Units\",\n  \"body\": \"The starter kit comes only with a units menu in the store. They are not instantiated on the game map upon completion of building time. ([Get the Pro or Complete Kit](https://www.citybuildingkit.com/#pricing))\"\n}\n[/block]\n\n[block:embed]\n{\n  \"html\": \"<iframe class=\\\"embedly-embed\\\" src=\\\"//cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FayfLhqk0JwE%3Ffeature%3Doembed&url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DayfLhqk0JwE%26feature%3Dyoutu.be&image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FayfLhqk0JwE%2Fhqdefault.jpg&key=02466f963b9b4bb8845a05b53d3235d7&type=text%2Fhtml&schema=youtube\\\" width=\\\"854\\\" height=\\\"480\\\" scrolling=\\\"no\\\" frameborder=\\\"0\\\" allowfullscreen></iframe>\",\n  \"url\": \"https://www.youtube.com/watch?v=ayfLhqk0JwE&feature=youtu.be\",\n  \"title\": \"Replace Unit - Tutorial #4B\",\n  \"favicon\": \"https://s.ytimg.com/yts/img/favicon-vflz7uhzw.ico\",\n  \"image\": \"https://i.ytimg.com/vi/ayfLhqk0JwE/hqdefault.jpg\"\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"How to Replace Units in the Menu\"\n}\n[/block]\nIn the Sprites_NGUI folder there are 2 folders with images used in the interfaces:\n[block:parameters]\n{\n  \"data\": {\n    \"0-0\": \"**CharBody** (previously called CharFullBody)\",\n    \"1-0\": \"**CharPortrait** (previously called Characters)\",\n    \"0-1\": \"fixed width 130px, variable height\",\n    \"1-1\": \"fixed width/height 130x130px\",\n    \"h-0\": \"Folder Name\",\n    \"h-1\": \"Image Characteristics\"\n  },\n  \"cols\": 2,\n  \"rows\": 2\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"1. Open the NGUI Atlas Maker\"\n}\n[/block]\nThe menus currently active in the game only use the portraits. You can see the atlas in SpriteAtlases_NGUI/GUI. The images that appear in the buttons are in PortraitsAtlas.\n\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://www.filepicker.io/api/file/EgjiNlST4mTaJE3klu9B\",\n        \"04_06_open_atlas_maker.jpg\",\n        \"1000\",\n        \"562\",\n        \"#6baa4a\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"2. Create a New Atlas\"\n}\n[/block]\nSelect the images you intend to use for your units portraits/full body/buildings, right click, go to **NGUI>Open Atlas Maker** and create a new atlas.\nSimilarly you can also add/update the existing PortraitsAtlas with your new images.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://www.filepicker.io/api/file/YAAr9ncCTzeGaqpQKDCI\",\n        \"05_01_create_atlas.jpg\",\n        \"1000\",\n        \"562\",\n        \"#6ba94a\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"3. Save the atlas in SpriteAtlases_NGUI/GUI\"\n}\n[/block]\nThen do the following:\n1. Go to UIAnchor/Anchor - Center and:\n\n**For Units:**\n**Activate Shop\nDeactivate 02Buildings\nActivate 03Creature**\nIn **03Creature/Page0/00Wizard/01Graphics/SpPic**, change the atlas and the sprite for the first unit. You can rename these buttons, but keep the 00 prefix to preserve the order - 00Wizard can become 00Peasant, for instance.\n\n**For Buildings:**\n**Activate Shop\n02Buildings should already be active**\nIn **02Buildings/Page0/00Academy/01Pic**, change the atlas and the sprite for the first building. You can rename these buttons, but keep the 00 prefix to preserve the order - 00Academy can become 00NewBuilding, for instance.\nBe sure to change the **02Buildings/Page0/00Academy/Button/Coin** image as well for the correct currency you will be using(mana/coin) for that building.\n\n2. Repeat this for all the necessary units/Buildings; you can deactivate the buttons if you have less units.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://www.filepicker.io/api/file/wQH1c0WIQZ6j0ZKELuDs\",\n        \"05_02_unit_menu_pics.jpg\",\n        \"1000\",\n        \"562\",\n        \"#71a0b4\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"4. Update each SpPic(Buildings shown in replace buildings doc)\"\n}\n[/block]\nRepeat this for every **03Creature/QueButtons/00BtQue/01Picture/SpPic**:\n - After you are finished:\n**Deactivate ALL QueButtons\nDeactivate 03Creature\nActivate 02Buildings\nDeactivate Shop**\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://www.filepicker.io/api/file/u6Xh5jf7QKmPPM8A0pjz\",\n        \"05_03_unit_que.jpg\",\n        \"1000\",\n        \"562\",\n        \"#6ea94a\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Next, update the Creatures.xml file(Buildings.xml for buildings)\"\n}\n[/block]\nOpen the Creatures.xml documentation page by clicking [here](https://www.citybuildingkit.com/documentation/v1.0/docs/creaturesxml.html) to learn how to set the data for each unit you've just added/replaced above to the in-game menu.\n\nOpen the Buildings.xml documentation page by clicking [here](https://www.citybuildingkit.com/documentation/v1.0/docs/buildingxml.html) to learn how to set the data for each building you've just added/replaced above to the in-game menu.","excerpt":"How to replace character sprites in the Units Menu","slug":"units-menu","type":"basic","title":"Units Menu"}

Units Menu

How to replace character sprites in the Units Menu

[block:callout] { "type": "success", "title": "Only Pro and Complete Kits Have Instantiated Units", "body": "The starter kit comes only with a units menu in the store. They are not instantiated on the game map upon completion of building time. ([Get the Pro or Complete Kit](https://www.citybuildingkit.com/#pricing))" } [/block] [block:embed] { "html": "<iframe class=\"embedly-embed\" src=\"//cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FayfLhqk0JwE%3Ffeature%3Doembed&url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DayfLhqk0JwE%26feature%3Dyoutu.be&image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FayfLhqk0JwE%2Fhqdefault.jpg&key=02466f963b9b4bb8845a05b53d3235d7&type=text%2Fhtml&schema=youtube\" width=\"854\" height=\"480\" scrolling=\"no\" frameborder=\"0\" allowfullscreen></iframe>", "url": "https://www.youtube.com/watch?v=ayfLhqk0JwE&feature=youtu.be", "title": "Replace Unit - Tutorial #4B", "favicon": "https://s.ytimg.com/yts/img/favicon-vflz7uhzw.ico", "image": "https://i.ytimg.com/vi/ayfLhqk0JwE/hqdefault.jpg" } [/block] [block:api-header] { "type": "basic", "title": "How to Replace Units in the Menu" } [/block] In the Sprites_NGUI folder there are 2 folders with images used in the interfaces: [block:parameters] { "data": { "0-0": "**CharBody** (previously called CharFullBody)", "1-0": "**CharPortrait** (previously called Characters)", "0-1": "fixed width 130px, variable height", "1-1": "fixed width/height 130x130px", "h-0": "Folder Name", "h-1": "Image Characteristics" }, "cols": 2, "rows": 2 } [/block] [block:api-header] { "type": "basic", "title": "1. Open the NGUI Atlas Maker" } [/block] The menus currently active in the game only use the portraits. You can see the atlas in SpriteAtlases_NGUI/GUI. The images that appear in the buttons are in PortraitsAtlas. [block:image] { "images": [ { "image": [ "https://www.filepicker.io/api/file/EgjiNlST4mTaJE3klu9B", "04_06_open_atlas_maker.jpg", "1000", "562", "#6baa4a", "" ] } ] } [/block] [block:api-header] { "type": "basic", "title": "2. Create a New Atlas" } [/block] Select the images you intend to use for your units portraits/full body/buildings, right click, go to **NGUI>Open Atlas Maker** and create a new atlas. Similarly you can also add/update the existing PortraitsAtlas with your new images. [block:image] { "images": [ { "image": [ "https://www.filepicker.io/api/file/YAAr9ncCTzeGaqpQKDCI", "05_01_create_atlas.jpg", "1000", "562", "#6ba94a", "" ] } ] } [/block] [block:api-header] { "type": "basic", "title": "3. Save the atlas in SpriteAtlases_NGUI/GUI" } [/block] Then do the following: 1. Go to UIAnchor/Anchor - Center and: **For Units:** **Activate Shop Deactivate 02Buildings Activate 03Creature** In **03Creature/Page0/00Wizard/01Graphics/SpPic**, change the atlas and the sprite for the first unit. You can rename these buttons, but keep the 00 prefix to preserve the order - 00Wizard can become 00Peasant, for instance. **For Buildings:** **Activate Shop 02Buildings should already be active** In **02Buildings/Page0/00Academy/01Pic**, change the atlas and the sprite for the first building. You can rename these buttons, but keep the 00 prefix to preserve the order - 00Academy can become 00NewBuilding, for instance. Be sure to change the **02Buildings/Page0/00Academy/Button/Coin** image as well for the correct currency you will be using(mana/coin) for that building. 2. Repeat this for all the necessary units/Buildings; you can deactivate the buttons if you have less units. [block:image] { "images": [ { "image": [ "https://www.filepicker.io/api/file/wQH1c0WIQZ6j0ZKELuDs", "05_02_unit_menu_pics.jpg", "1000", "562", "#71a0b4", "" ] } ] } [/block] [block:api-header] { "type": "basic", "title": "4. Update each SpPic(Buildings shown in replace buildings doc)" } [/block] Repeat this for every **03Creature/QueButtons/00BtQue/01Picture/SpPic**: - After you are finished: **Deactivate ALL QueButtons Deactivate 03Creature Activate 02Buildings Deactivate Shop** [block:image] { "images": [ { "image": [ "https://www.filepicker.io/api/file/u6Xh5jf7QKmPPM8A0pjz", "05_03_unit_que.jpg", "1000", "562", "#6ea94a", "" ] } ] } [/block] [block:api-header] { "type": "basic", "title": "Next, update the Creatures.xml file(Buildings.xml for buildings)" } [/block] Open the Creatures.xml documentation page by clicking [here](https://www.citybuildingkit.com/documentation/v1.0/docs/creaturesxml.html) to learn how to set the data for each unit you've just added/replaced above to the in-game menu. Open the Buildings.xml documentation page by clicking [here](https://www.citybuildingkit.com/documentation/v1.0/docs/buildingxml.html) to learn how to set the data for each building you've just added/replaced above to the in-game menu.