Jump to content

Recommended Posts

Posted (edited)

Hello everyone, people often ask me how to help me.


Here I will describe the general principle of how to create a simple window for ui (unity l2)

 

Here I am looking at an already created ActionWindows window

 

1. Assets\Resources\Data\UI\_Elements\Game

2. image.thumb.png.403e3a7e5c8807f396115c7856945f85.png

 

Let's call it ActionWindows

3. Let's go to the newly created window

image.png.eb3690d3e0052e3a32e3feea2609413e.png

4.as you can see it is empty. But we already have a ready-made window template so that we don’t have to assemble it again every time. We will connect a ready-made design for a new window

5. open the window code

image.png.de8bbde2494d0bc383e4bbc22c896e77.png

6.image.png.e97aa9a16f53f4b97141f0ece13d5c58.png

7. Add new code 

<ui:UXML xmlns:ui="UnityEngine.UIElements" xmlns:uie="UnityEditor.UIElements" xmlns="UnityEngine.UIElements" editor-extension-mode="False">
    <ui:Template name="DefaultWindowsAction" src="project://database/Assets/Resources/Data/UI/_Elements/Template/DefaultWindowsAction.uxml?fileID=9197481963319205126&amp;guid=2fdd4636702f00a4e98644cfa7468b14&amp;type=3#DefaultWindowsAction" />
    <ui:Instance name="defaultWindowsAction" template="DefaultWindowsAction" style="width: 317px; height: 575px; position: absolute;">
        <AttributeOverrides element-name="windows-name-label" text="Actions" />
        <ui:VisualElement name="Background" class="background_over" style="flex-grow: 1; min-width: auto; min-height: auto; justify-content: flex-start; align-items: flex-start; position: absolute; background-image: resource(&apos;Data/UI/Window/Frame_DF_Large_Bg_Darker_Center_Alpha&apos;); height: 91%; top: 38px; width: 95%; left: 8px; display: flex; visibility: visible; overflow: visible; opacity: 1;" />
        <ui:GroupBox name="BoxHeader" class="drag-area" style="margin-top: 0; margin-right: 0; margin-bottom: 0; margin-left: 0; padding-top: 0; padding-bottom: 0; padding-left: 0; position: absolute; top: 15px; align-self: stretch; height: 4%; width: 88%;" />
     
    </ui:Instance>
</ui:UXML>

 

8.We take a template 
project://database/Assets/Resources/Data/UI/_Elements/Template/DefaultWindowsAction.uxml

9. This piece of code can be taken from other windows so as not to write every time

10. Save

image.thumb.png.45ca4fc9eeee4e07133981e39190b499.png

11.Drag the GroupBox node

 

image.thumb.png.e20939777d278ce7900269220351d629.png

12.

Changing its position settings

sssssssss7.png

 

I can change all the settings from the editor. But if you knew, then a very similar technology to CSS is better

 

ssss9-2.png

if you open the window code you can notice everything is the same as in css
you can create settings in the window code or use a file with all the styles

 

Assets\Resources\Data\UI\_Elements\L2StyleSheet.uss

ssss10.png


In the next issue we will write code to connect it to the game logic. Unless of course you delete the article.

 

Edited by Gawric

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Posts

    • Aurelian is a free Lineage 2 website template for L2J and L2Off/PTS servers, with a medieval/gold design and three visual themes.   You can use it as a completely standalone website, connect it to Forgeport for live server data, or have the website hosted directly by Forgeport.   Forgeport is a hosted player portal, website and donation store platform for Lineage 2 servers.   The important distinction here: you do not need Forgeport to use Aurelian. The static edition is a complete standalone website.   What’s inside: Hero News Features Rates Store Vote Rankings Sieges Bosses Media Download FAQ   Three themes are included: Royal Gold Crimson Frozen   Two downloadable editions: Static — complete standalone site. Edit index.html and upload it to any static host. Zero build process, everything is bundled locally and there are no CDN dependencies. No Forgeport subscription required. Forgeport-integrated — same self-hosted website, but live sections such as players online, rankings, sieges, store, vote and news pull their data from your Forgeport portal’s public read-only API. This edition requires an active Forgeport subscription.   Hosted version If you use Forgeport, you don’t have to host the website yourself. When you claim Aurelian, your account also gets an activation code / handoff link. Activate it on your Forgeport organization and the website is served directly by Forgeport with the live portal data connected.   So there are three ways to use it: Static → standalone, self-hosted Integrated → self-hosted + Forgeport live data Hosted → served directly by Forgeport + live data   How to get it Create a free account at https://shop.forgeport.net Open Aurelian (€0) and claim it. Download the edition you want, or use the activation code / handoff link for the hosted version.   No card required.   For clarity: the static edition is fully usable standalone and does not require a Forgeport account or subscription. You only need the free shop account to claim and download the files.     Links Aurelian / download: https://shop.forgeport.net/ro/en/products/aurelian-lineage-2-website-template Forgeport: https://forgeport.net Documentation: https://docs.forgeport.net/docs There are also other Lineage 2 website templates available in the shop.   Two images attached: cover + full-page preview.   Please report issues in this thread  
    • September update: Aurelian is now free   AURELIAN, the medieval/gold Lineage 2 website template, is now free. It includes all three themes: Royal Gold, Crimson and Frozen.   You can have it as: Hosted on Forgeport — activate it on your Forgeport organization. Forgeport serves the website and supplies the live data; nothing to host. Can be modified at your will.  Static — complete standalone site. Edit index.html and upload it to any static host. Zero build process, everything bundled locally, no CDNs. Forgeport-integrated — same self-hosted site, but players online, rankings, sieges, store, vote and news use your portal’s public read-only API. This edition requires an active Forgeport subscription. There are also other Lineage 2 website templates available in the shop.   Claim Aurelian for €0: https://shop.forgeport.net
    • I played this server about 3 years. Many polish and greek players where inside. ShadowHunterIiI was my name. I remember many players like KakoulisGr,JohnRambo,Ephen,Eldar,Nerous etc. Our clan was DeadlySouls. Awesome years we create so many memories and friendships that got lost in the years after the close of the server.
  • Topics

×
×
  • Create New...

Important Information

This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..