Jump to content

[Tuto] Customize the GUI


Recommended Posts

Hello everyone, I didn't see any totorial to explain how to change the GUI. So, I will try to write one. I'm not English, so if they are mistakes, moderators could edit this. 

I will update this tutorial when I will found new things (I learn from analysing the source code).

 

Customize your Gui

0.Create a mod

1. Add a new panel

2. Coming soon ...

 

0.Create a mod

  1. Go in the folder where you install 0ad : "0 A.D. alpha" then into  "0 A.D. alpha\binaries\data\mods"
  2. Create a new folder with the name of you mod (replace space by _)
  3. Go in "0 A.D. alpha\binaries\data\mods\public" ; copy "mod.json" in your own mod directory
  4. Edit the file with Notepad++ : after "label :" delete "0 A.D. Empires Ascendant" and enter the name of your own mod ; you can also change the description

Congratulations ! Now your mod appears in the mod selection of 0ad !

1. Add a new panel

  1. In the directory of your mod, create these folders : "\gui\session"
  2. Go into the public mod folder (0 A.D. alpha\binaries\data\mods\public) open the zip file and then go in gui\session. Copy session.xml and sprites.xml in your own session folder.
  3. Edit session.xml with Notepad++ : line 103 add "<include file="gui/session/the_name_of_your_panel.xml"/>"
  4. Edit sprites.xml : after "<!-- Panel Backgrounds -->" (line 27) add :
	<sprite name="the_name_of_your_sprite">
		<image texture="session/folder_of_my_pictures/name_of_my_background_picture.png"
			texture_size="0 0 100% 100%"
			size="0 0 100% 100%"
		/>
	</sprite>

5. Create in the folder session a file named the_name_of_your_panel.xml , then edit it :

<?xml version="1.0" encoding="utf-8"?>
<object name="the_name_of_your_panel"
	type="image"
	sprite="the_name_of_your_sprite"
	size="coordinateX1 coordinateY1 coordinateX2 coordinateY2"
	tooltip_style="sessionToolTip">
</object>

You must define the placement of your panel with its coordinates.

6. Place the background picture of your panel in name_of_your_mod\art\textures\ui\session\folder_of_my_picture\name_of_my_background_picture.png

Launch 0ad and activate your mod. Your panel is now present during your game !

  • Like 2
  • Thanks 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...